How to alter table in Postgres to show Timestamp with Time Zone abbreviation (2004-10-19 10:23:54 EST)
我想改变我的表格行从2011-06-30 05:59:59 + 00格式变成2011-06-30 05:59:59 CDT格式
正如蒂姆所说,postgres不存储
timezone (string)
Sets the time zone for displaying and interpreting
time stamps. If not explicitly set, the server initializes this
variable to the time zone specified by its system environment. See
Section 8.5.3 for more information.
并使用格式显示
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | b=# SELECT now(); now ----------------------------- 2016-12-07 15:13:35.1369+00 (1 ROW) b=# SET timezone = EST; SET b=# SELECT to_char(now(),'YYYY-MM-DD HH24:MI:SS TZ'); to_char ------------------------- 2016-12-07 10:13:55 EST (1 ROW) |