Files
DBAdmin/inbox/DataBase/PostgreSQL/database/timezone.sql
T
2026-05-18 06:40:19 +00:00

34 lines
665 B
SQL

-- Below commands can be used to find postgres db date/timestamp
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