11<!--
2- $Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.3 1999/05/26 17:30:28 thomas Exp $
2+ $Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.4 1999/06/23 06: 17:51 thomas Exp $
33Date/time details
44
55$Log: datetime.sgml,v $
6+ Revision 2.4 1999/06/23 06:17:51 thomas
7+ Clarify input/output timezone information.
8+ Add detail on exact interpretation of "concatenated date"
9+ for various lengths.
10+
611Revision 2.3 1999/05/26 17:30:28 thomas
712Add chapters on CVS access, MVCC, SQL theory to the docs.
813Add an appendix with more details on date/time attributes and handling.
@@ -23,6 +28,12 @@ Finish initial markup of cvs.sgml, and include it in the programmer's guide
2328 <title>Time Zones</title>
2429
2530 <para>
31+ <productname>Postgres</productname> must have internal tabular
32+ information for time zone decoding, since there is no *nix standard
33+ system interface to provide access to general, cross-timezone
34+ information. The underlying OS <emphasis>is</emphasis> used to
35+ provide time zone information for <emphasis>output</emphasis>.
36+
2637 <table tocentry="1">
2738 <title><productname>Postgres</productname> Recognized Time Zones</title>
2839 <titleabbrev>Time Zones</titleabbrev>
@@ -504,23 +515,23 @@ Finish initial markup of cvs.sgml, and include it in the programmer's guide
504515 <step>
505516 <para>
506517 The token is a number or number field.
507- If there are more than 4 digits,
508- and if no other date fields have been previously read, then interpret
509- as a "concatenated date" (e.g. <literal>19990118</literal>).
510518 </para>
511-
519+
512520 <substeps>
513521 <step>
514522 <para>
515523 If there are more than 4 digits,
516524 and if no other date fields have been previously read, then interpret
517- as a "concatenated date" (e.g. <literal>19990118</literal>).
525+ as a "concatenated date" (e.g. <literal>19990118</literal>). 8
526+ and 6 digits are interpreted as year, month, and day, while 7
527+ and 5 digits are interpreted as year, day of year.
518528 </para>
519529 </step>
520530
521531 <step>
522532 <para>
523- If three digits and a year has already been decoded, then interpret as day of year.
533+ If the token is three digits
534+ and a year has already been decoded, then interpret as day of year.
524535 </para>
525536 </step>
526537
@@ -568,8 +579,10 @@ Finish initial markup of cvs.sgml, and include it in the programmer's guide
568579
569580 <step>
570581 <para>
571- If BC has been specified, negate the year and offset by one
572- (there is no year zero in the Gregorian calendar).
582+ If BC has been specified, negate the year and offset by one for
583+ internal storage
584+ (there is no year zero in the Gregorian calendar, so numerically
585+ 1BC becomes year zero).
573586 </para>
574587 </step>
575588
@@ -578,9 +591,18 @@ Finish initial markup of cvs.sgml, and include it in the programmer's guide
578591 If BC was not specified, and if the year field was two digits in length, then
579592 adjust the year to 4 digits. If the field was less than 70, then add 2000;
580593 otherwise, add 1900.
594+
595+ <tip>
596+ <para>
597+ Gregorian years 1-99AD may be entered by using 4 digits with leading
598+ zeros (e.g. 0099 is 99AD). Three digits are also accepted as a
599+ year under most circumstances, though depending on position the
600+ numeric string may
601+ be interpreted as doy instead.
602+ </para>
603+ </tip>
581604 </para>
582605 </step>
583-
584606 </procedure>
585607 </sect1>
586608
@@ -595,9 +617,9 @@ Finish initial markup of cvs.sgml, and include it in the programmer's guide
595617 </note>
596618
597619 <para>
598- The Julian Day invented by the French scholar
620+ The Julian Daywas invented by the French scholar
599621 Joseph Justus Scaliger (1540-1609)
600- andwhich probably takes its name from the Scaliger's father,
622+ and probably takes its name from the Scaliger's father,
601623 the Italian scholar Julius Caesar Scaliger (1484-1558).
602624 Astronomers have used the Julian period to assign a unique number to
603625 every day since 1 January 4713 BC. This is the so-called Julian Day
@@ -606,7 +628,7 @@ Finish initial markup of cvs.sgml, and include it in the programmer's guide
606628 </para>
607629
608630 <para>
609- Julian Day is different from Julian Date.
631+ <quote> Julian Day</quote> is different from<quote> Julian Date</quote> .
610632
611633 The Julian calendar was introduced by Julius Caesar in 45 BC. It was
612634 in common use until the 1582, when countries started changing to the
@@ -633,13 +655,13 @@ Finish initial markup of cvs.sgml, and include it in the programmer's guide
633655
634656 <simplelist>
635657 <member>
636- Every year divisible by 4 is a leap year.
658+ Every year divisible by 4 is a leap year.
637659 </member>
638660 <member>
639- However, every year divisible by 100 is not a leap year.
661+ However, every year divisible by 100 is not a leap year.
640662 </member>
641663 <member>
642- However, every year divisible by 400 is a leap year after all.
664+ However, every year divisible by 400 is a leap year after all.
643665 </member>
644666 </simplelist>
645667