Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita77275f

Browse files
committed
Please find attached two patches for documentation and regression tests
for the usage of full time zone names.Joachim Wieland
1 parent956cbeb commita77275f

File tree

12 files changed

+309
-69
lines changed

12 files changed

+309
-69
lines changed

‎doc/src/sgml/datatype.sgml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.168 2006/06/18 15:38:35 petere Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.169 2006/07/06 01:46:37 momjian Exp $ -->
22

33
<chapter id="datatype">
44
<title id="datatype-title">Data Types</title>
@@ -1602,7 +1602,12 @@ SELECT b, char_length(b) FROM test2;
16021602
linkend="datatype-datetime-time-table">
16031603
and <xref linkend="datatype-timezone-table">.) If a time zone is
16041604
specified in the input for <type>time without time zone</type>,
1605-
it is silently ignored.
1605+
it is silently ignored. You can also always specify a date but it will
1606+
be ignored except for when you use a full time zone name like
1607+
<literal>America/New_York</literal>. In this case specifying the date
1608+
is compulsory in order to tell which time zone offset should be
1609+
applied. It will be applied whatever time zone offset was valid at that
1610+
date and time at the specified place.
16061611
</para>
16071612

16081613
<table id="datatype-datetime-time-table">
@@ -1659,6 +1664,10 @@ SELECT b, char_length(b) FROM test2;
16591664
<entry><literal>04:05:06 PST</literal></entry>
16601665
<entry>time zone specified by name</entry>
16611666
</row>
1667+
<row>
1668+
<entry><literal>2003-04-12 04:05:06 America/New_York</literal></entry>
1669+
<entry>time zone specified by full name</entry>
1670+
</row>
16621671
</tbody>
16631672
</tgroup>
16641673
</table>
@@ -1677,6 +1686,10 @@ SELECT b, char_length(b) FROM test2;
16771686
<entry><literal>PST</literal></entry>
16781687
<entry>Pacific Standard Time</entry>
16791688
</row>
1689+
<row>
1690+
<entry><literal>America/New_York</literal></entry>
1691+
<entry>Full time zone name</entry>
1692+
</row>
16801693
<row>
16811694
<entry><literal>-8:00</literal></entry>
16821695
<entry>ISO-8601 offset for PST</entry>
@@ -1739,8 +1752,12 @@ SELECT b, char_length(b) FROM test2;
17391752
</programlisting>
17401753

17411754
are valid values, which follow the <acronym>ISO</acronym> 8601
1742-
standard. In addition, the wide-spread format
1755+
standard. You can also specify the full time zone name as in
1756+
<programlisting>
1757+
1999-01-08 04:05:06 America/New_York
1758+
</programlisting>
17431759

1760+
In addition, the wide-spread format
17441761
<programlisting>
17451762
January 8 04:05:06 1999 PST
17461763
</programlisting>

‎doc/src/sgml/datetime.sgml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.49 2006/04/23 03:39:50 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.50 2006/07/06 01:46:37 momjian Exp $ -->
22

33
<appendix id="datetime-appendix">
44
<title>Date/Time Support</title>
@@ -46,7 +46,9 @@
4646
<para>
4747
If the numeric token contains a dash (<literal>-</>), slash
4848
(<literal>/</>), or two or more dots (<literal>.</>), this is
49-
a date string which may have a text month.
49+
a date string which may have a text month. In case of a slash
50+
(<literal>/</>) it can also be a full time zone name like
51+
<literal>America/New_York</>.
5052
</para>
5153
</step>
5254

@@ -359,7 +361,8 @@
359361
</indexterm>
360362

361363
<para>
362-
<xref linkend="datetime-timezone-input-table"> shows the time zone
364+
<xref linkend="datetime-timezone-input-table"> and
365+
<xref linkend="datetime-timezone-full-names-table"> show the time zone
363366
abbreviations recognized by <productname>PostgreSQL</productname>
364367
in date/time input values. Note that these names are <emphasis>not</>
365368
necessarily used for date/time output &mdash; output is driven by the
@@ -983,13 +986,15 @@
983986
</indexterm>
984987

985988
<para>
986-
<xref linkend="datetime-timezone-set-table"> shows the time zone
989+
<xref linkend="datetime-timezone-full-names-table"> shows the time zone
987990
names recognized by <productname>PostgreSQL</productname> as valid
988991
settings for the <xref linkend="guc-timezone"> parameter. Note that
989992
these names are conceptually as well as practically different from
990993
the names shown in <xref linkend="datetime-timezone-input-table">:
991994
most of these names imply a local daylight-savings time rule, whereas
992-
the former names each represent just a fixed offset from UTC.
995+
the former names each represent just a fixed offset from UTC. That's why
996+
you always have to specify a date if you want to use these time zone
997+
names in <type>timetz</> values.
993998
</para>
994999

9951000
<para>
@@ -998,8 +1003,8 @@
9981003
by the name of the principal city of the zone.
9991004
</para>
10001005

1001-
<table id="datetime-timezone-set-table">
1002-
<title>Time Zone Names forSetting <varname>timezone</></title>
1006+
<table id="datetime-timezone-full-names-table">
1007+
<title>Time Zone Names fordate/time input values and for setting <varname>timezone</></title>
10031008
<tgroup cols="1">
10041009
<thead>
10051010
<row>

‎doc/src/sgml/func.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.323 2006/06/19 16:13:01 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.324 2006/07/06 01:46:37 momjian Exp $ -->
22

33
<chapter id="functions">
44
<title>Functions and Operators</title>
@@ -6099,7 +6099,7 @@ SELECT date_trunc('year', TIMESTAMP '2001-02-16 20:38:40');
60996099
specified either as a text string (e.g., <literal>'PST'</literal>)
61006100
or as an interval (e.g., <literal>INTERVAL '-08:00'</literal>).
61016101
In the text case, the available zone names are those shown in either
6102-
<xref linkend="datetime-timezone-set-table"> or
6102+
<xref linkend="datetime-timezone-full-names-table"> or
61036103
<xref linkend="datetime-timezone-input-table">.
61046104
</para>
61056105

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp