Created
July 19, 2014 14:14
-
-
Save tototoshi/61831d5be9275990e139 to your computer and use it in GitHub Desktop.
timestamp with time zone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
example=# CREATE TABLE tstest (ts1 timestamp, ts2 timestamp with time zone); | |
CREATE TABLE | |
example=# \d tstest; | |
Table "public.tstest" | |
Column | Type | Modifiers | |
--------+-----------------------------+----------- | |
ts1 | timestamp without time zone | | |
ts2 | timestamp with time zone | | |
example=# INSERT INTO tstest VALUES (current_timestamp, current_timestamp); | |
INSERT 0 1 | |
example=# SELECT * FROM tstest; | |
ts1 | ts2 | |
----------------------------+------------------------------- | |
2014-07-19 23:11:38.230859 | 2014-07-19 23:11:38.230859+09 | |
(1 row) | |
example=# INSERT INTO tstest VALUES (current_timestamp, '2014-07-19 23:12:00+08'); | |
INSERT 0 1 | |
example=# SELECT * FROM tstest; | |
ts1 | ts2 | |
----------------------------+------------------------------- | |
2014-07-19 23:11:38.230859 | 2014-07-19 23:11:38.230859+09 | |
2014-07-19 23:13:29.347091 | 2014-07-20 00:12:00+09 | |
(2 rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment