![]() ![]() Postgres=# select ' 10:15pm US/Eastern'::timestampandtz at time zone 'utc' timestampĬasts to timestamptz follow the same rules as normal timestamptz. Postgres=# select ' 10:15pm US/Eastern'::timestampandtz::timestamp timestamp Since the "at time zone" clause is also supported, the default, un-adorned conversion is to UTC: Cast to timestampĬasts to timestamp are always done from the local timestamp of the timestampandtz. The type supports casting from both timestamp and timestamptz and to both timestamp and timestamptz. The timezone IDs are fixed, and are simply a list of timezones from pg_timezone_names with each timezone assigned a specific fixed ID. The internal binary format of timestampandtz is 10 bytes with the standard 8-byte timestamp (in UTC) combines with a 2-byte timezone ID. You can see that the output is always the local time with the timezone displayed. ![]() Postgres=# select ' 10:15pm US/Pacific'::timestampandtz timestampandtz Using this format, the type also supports a forced timezone (doesn't matter what the session time zone is set to): The format for the input/output of direct timestampandtz is. ![]() Postgres=# select ' 10:15pm'::timestampandtz timestampandtz The standard timestamp date parsing is supported with the implicit session timezone: The type supports both input and output from text format both with a specified timezone and with the implicit session/database time zone. A postgresql date/time type that stores both the timestamp and the timezone. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |