time [ (p) ] [ without time zone ]
8 bytes
times of day only
- 00:00:00.00
+ 00:00:00
24:00:00
1 microsecond / 14 digits
time [ (p) ] with time zone
12 bytes
times of day only, with time zone
- 00:00:00.00+12
- 24:00:00-12
+ 00:00:00+1359
+ 24:00:00-1359
1 microsecond / 14 digits
The
SQL standard differentiates
timestamp without time zone
- and timestamp with time zone literals by the existence of a
- +
; or -
. Hence, according to the standard,
+ and timestamp with time zone literals by the presence of a
+ +
or -
. Hence, according to the standard,
TIMESTAMP '2004-10-19 10:23:54'
is a timestamp without time zone, while
TIMESTAMP '2004-10-19 10:23:54+02'
is a timestamp with time zone.
- differs from the standard by requiring that timestamp with time zone
- literals be explicitly typed:
+
PostgreSQL never examines the content of a
+ literal string before determining its type, and therefore will treat
+ both of the above as timestamp without time zone. To
+ ensure that a literal is treated as timestamp with time
+ zone, give it the correct explicit type:
TIMESTAMP WITH TIME ZONE '2004-10-19 10:23:54+02'
- If a literal is not explicitly indicated as being of timestamp with time zone,
-
PostgreSQL will silently ignore any time zone indication in the literal.
- That is, the resulting date/time value is derived from the date/time
+ In a literal that has been decided to be timestamp without time
+ zone,
PostgreSQL will silently ignore
+ any time zone indication.
+ That is, the resulting value is derived from the date/time
fields in the input value, and is not adjusted for time zone.