Answers for "postgres timestamps"

SQL
1

postgres get timestamp

SELECT CURRENT_TIMESTAMP;
Posted by: Guest on December-12-2020
0

unix timestamp postgres

select now(),
       extract(epoch from now()),                                          -- correct
       extract(epoch from now() at time zone 'utc'),                       -- incorrect
       extract(epoch from now() at time zone 'utc' at time zone 'utc');    -- correct

          now                  |    date_part     |    date_part     |    date_part
-------------------------------+------------------+------------------+------------------
 2014-10-14 10:19:23.726908+02 | 1413274763.72691 | 1413267563.72691 | 1413274763.72691
(1 row)
Posted by: Guest on June-08-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language