ステートメントは日付と時刻を教えてくれます。
ステートメントを変更して、日付だけを返し(時刻は返さないように)するにはどうすればよいですか?
SELECT to_timestamp( TRUNC( CAST( Epoch_ms AS bigint ) / 1000 ) );
/* Current time */
select now();
/* Epoch from current time;
Epoch is number of seconds since 1970-01-01 00:00:00+00 */
select extract(Epoch from now());
/* Get back time from Epoch */
-- Option 1 - use to_timestamp function
select to_timestamp( extract(Epoch from now()));
-- Option 2 - add seconds to 'Epoch'
select timestamp with time zone 'Epoch'
+ extract(Epoch from now()) * interval '1 second';
/* Cast timestamp to date */
-- Based on Option 1
select to_timestamp(extract(Epoch from now()))::date;
-- Based on Option 2
select (timestamp with time zone 'Epoch'
+ extract(Epoch from now()) * interval '1 second')::date;
/* For column Epoch_ms */
select to_timestamp(extract(Epoch epoch_ms))::date;