From a77275fe3b79d06c9db7c699394416230f6a3fe9 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 6 Jul 2006 01:46:38 +0000 Subject: Please find attached two patches for documentation and regression tests for the usage of full time zone names. Joachim Wieland --- doc/src/sgml/datatype.sgml | 23 ++++++++++++++++++++--- doc/src/sgml/datetime.sgml | 19 ++++++++++++------- doc/src/sgml/func.sgml | 4 ++-- 3 files changed, 34 insertions(+), 12 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 7722f958c14..35e71004c18 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1,4 +1,4 @@ - + Data Types @@ -1602,7 +1602,12 @@ SELECT b, char_length(b) FROM test2; linkend="datatype-datetime-time-table"> and .) If a time zone is specified in the input for time without time zone, - it is silently ignored. + it is silently ignored. You can also always specify a date but it will + be ignored except for when you use a full time zone name like + America/New_York. In this case specifying the date + is compulsory in order to tell which time zone offset should be + applied. It will be applied whatever time zone offset was valid at that + date and time at the specified place. @@ -1659,6 +1664,10 @@ SELECT b, char_length(b) FROM test2; 04:05:06 PSTtime zone specified by name + + 2003-04-12 04:05:06 America/New_York + time zone specified by full name +
@@ -1677,6 +1686,10 @@ SELECT b, char_length(b) FROM test2; PST Pacific Standard Time + + America/New_York + Full time zone name + -8:00 ISO-8601 offset for PST @@ -1739,8 +1752,12 @@ SELECT b, char_length(b) FROM test2; are valid values, which follow the ISO 8601 - standard. In addition, the wide-spread format + standard. You can also specify the full time zone name as in + +1999-01-08 04:05:06 America/New_York + + In addition, the wide-spread format January 8 04:05:06 1999 PST diff --git a/doc/src/sgml/datetime.sgml b/doc/src/sgml/datetime.sgml index 3603a6156e1..2bd42e5e52b 100644 --- a/doc/src/sgml/datetime.sgml +++ b/doc/src/sgml/datetime.sgml @@ -1,4 +1,4 @@ - + Date/Time Support @@ -46,7 +46,9 @@ If the numeric token contains a dash (-), slash (/), or two or more dots (.), this is - a date string which may have a text month. + a date string which may have a text month. In case of a slash + (/) it can also be a full time zone name like + America/New_York. @@ -359,7 +361,8 @@ - shows the time zone + and + show the time zone abbreviations recognized by PostgreSQL in date/time input values. Note that these names are not necessarily used for date/time output — output is driven by the @@ -983,13 +986,15 @@ - shows the time zone + shows the time zone names recognized by PostgreSQL as valid settings for the parameter. Note that these names are conceptually as well as practically different from the names shown in : most of these names imply a local daylight-savings time rule, whereas - the former names each represent just a fixed offset from UTC. + the former names each represent just a fixed offset from UTC. That's why + you always have to specify a date if you want to use these time zone + names in timetz values. @@ -998,8 +1003,8 @@ by the name of the principal city of the zone. - - Time Zone Names for Setting <varname>timezone</> +
+ Time Zone Names for date/time input values and for setting <varname>timezone</> diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 506fd816ca0..78f998e782e 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ - + Functions and Operators @@ -6099,7 +6099,7 @@ SELECT date_trunc('year', TIMESTAMP '2001-02-16 20:38:40'); specified either as a text string (e.g., 'PST') or as an interval (e.g., INTERVAL '-08:00'). In the text case, the available zone names are those shown in either - or + or . -- cgit v1.2.3