Find current data/time on postgres db
-- Below commands can be used to find postgres db date/timestamp
postgresql configurationintermediate
by PostgreSQL
15 views
-- Below commands can be used to find postgres db date/timestamp
123456789101112131415161718192021222324252627282930313233343536
postgres=#
SELECT CURRENT_TIMESTAMP;
current_timestamp
----------------------------------
2020-07-06 17:45:24.929293+05:30
(1 row)
postgres=#
select current_date;
current_date
--------------
2020-07-06
(1 row)
postgres=#
select statement_timestamp() ;
statement_timestamp
----------------------------------
2020-07-06 17:46:16.825492+05:30
(1 row)
postgres=#
select timeofday() ;
timeofday
-------------------------------------
Mon Jul 06 17:46:23.861551 2020 IST
(1 row)
postgres=#
select localtime(0);
localtime
-----------
17:52:38
(1 row)
postgres=#
select localtimestamp(0);
localtimestamp
---------------------
2020-07-06 17:52:48
(1 row)Please to add comments
No comments yet. Be the first to comment!