]> Dogcows Code - chaz/tar/blobdiff - doc/getdate.texi
Remove some lint caught by gcc -Wall -W, etc.
[chaz/tar] / doc / getdate.texi
index 6c3acd143e87abfa91397cd35b8fd29782681888..30d4d33727b51b3ff0349afbe97db5fc6abcf499 100644 (file)
@@ -1,6 +1,17 @@
 @node Date input formats
 @chapter Date input formats
 
+@c Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003 Free Software
+@c Foundation, Inc.
+
+@c Permission is granted to copy, distribute and/or modify this document
+@c under the terms of the GNU Free Documentation License, Version 1.1
+@c or any later version published by the Free Software Foundation;
+@c with no Invariant Sections, with no
+@c Front-Cover Texts, and with no Back-Cover Texts.
+@c A copy of the license is included in the section entitled ``GNU
+@c Free Documentation License''.
+
 @cindex date input formats
 @findex getdate
 
@@ -35,16 +46,16 @@ programs accept.  These are the strings you, as a user, can supply as
 arguments to the various programs.  The C interface (via the
 @code{getdate} function) is not described here.
 
-@cindex beginning of time, for @sc{posix}
-@cindex epoch, for @sc{posix}
+@cindex beginning of time, for @acronym{POSIX}
+@cindex epoch, for @acronym{POSIX}
 Although the date syntax here can represent any possible time since the
 year zero, computer integers often cannot represent such a wide range of
-time.  On @sc{posix} systems, the clock starts at 1970-01-01 00:00:00
-@sc{utc}: @sc{posix} does not require support for times before the
-@sc{posix} Epoch and times far in the future.  Traditional Unix systems
+time.  On @acronym{POSIX} systems, the clock starts at 1970-01-01 00:00:00
+@sc{utc}: @acronym{POSIX} does not require support for times before the
+@acronym{POSIX} Epoch and times far in the future.  Traditional Unix systems
 have 32-bit signed @code{time_t} and can represent times from 1901-12-13
 20:45:52 through 2038-01-19 03:14:07 @sc{utc}.  Systems with 64-bit
-signed @code{time_t} can represent all the times in the expected
+signed @code{time_t} can represent all the times in the known
 lifetime of the universe.
 
 @menu
@@ -55,7 +66,7 @@ lifetime of the universe.
 * Day of week items::              Monday and others.
 * Relative items in date strings:: next tuesday, 2 years ago.
 * Pure numbers in date strings::   19931219, 1440.
-* Authors of getdate::             Bellovin, Eggert, Berets, Salz, et al.
+* Authors of getdate::             Bellovin, Eggert, Salz, Berets, et al.
 @end menu
 
 
@@ -100,6 +111,34 @@ When a month is written this way, it is still considered to be written
 numerically, instead of being ``spelled in full''; this changes the
 allowed strings.
 
+@cindex language, in dates
+In the current implementation, only English is supported for words and
+abbreviations like @samp{AM}, @samp{DST}, @samp{EST}, @samp{first},
+@samp{January}, @samp{Sunday}, @samp{tomorrow}, and @samp{year}.
+
+@cindex language, in dates
+@cindex time zone item
+The output of @command{date} is not always acceptable as a date string,
+not only because of the language problem, but also because there is no
+standard meaning for time zone items like @samp{IST}.  When using
+@command{date} to generate a date string intended to be parsed later,
+specify a date format that is independent of language and that does not
+use time zone items other than @samp{UTC} and @samp{Z}.  Here are some
+ways to do this:
+
+@example
+$ LC_ALL=C TZ=UTC0 date
+Fri Dec 15 19:48:05 UTC 2000
+$ TZ=UTC0 date +"%Y-%m-%d %H:%M:%SZ"
+2000-12-15 19:48:05Z
+$ date --iso-8601=seconds  # a GNU extension
+2000-12-15T11:48:05-0800
+$ date --rfc-822  # a GNU extension
+Fri, 15 Dec 2000 11:48:05 -0800
+$ date +"%Y-%m-%d %H:%M:%S %z"  # %z is a GNU extension.
+2000-12-15 11:48:05 -0800
+@end example
+
 @cindex case, ignored in dates
 @cindex comments, in dates
 Alphabetic case is completely ignored in dates.  Comments may be introduced
@@ -238,13 +277,15 @@ but not both.
 @cindex time zone item
 
 A @dfn{time zone item} specifies an international time zone, indicated
-by a small set of letters, e.g., @samp{UTC} for Coordinated Universal
+by a small set of letters, e.g., @samp{UTC} or @samp{Z}
+for Coordinated Universal
 Time.  Any included periods are ignored.  By following a
 non-daylight-saving time zone by the string @samp{DST} in a separate
 word (that is, separated by some white space), the corresponding
 daylight saving time zone may be specified.
 
-Time zone items are obsolescent and are not recommended, because they
+Time zone items other than @samp{UTC} and @samp{Z}
+are obsolescent and are not recommended, because they
 are ambiguous; for example, @samp{EST} has a different meaning in
 Australia than in the United States.  Instead, it's better to use
 unambiguous numeric time zone corrections like @samp{-0500}, as
@@ -347,7 +388,7 @@ the resulting date and time are adjusted accordingly.
 @cindex pure numbers in date strings
 
 The precise interpretation of a pure decimal number depends
-the context in the date string.
+on the context in the date string.
 
 If the decimal number is of the form @var{yyyy}@var{mm}@var{dd} and no
 other calendar date item (@pxref{Calendar date items}) appears before it
@@ -371,19 +412,18 @@ year.
 @cindex authors of @code{getdate}
 
 @cindex Bellovin, Steven M.
+@cindex Salz, Rich
 @cindex Berets, Jim
-@cindex Eggert, Paul
 @cindex MacKenzie, David
 @cindex Meyering, Jim
-@cindex Salz, Rich
+@cindex Eggert, Paul
 @code{getdate} was originally implemented by Steven M. Bellovin
 (@email{smb@@research.att.com}) while at the University of North Carolina
 at Chapel Hill.  The code was later tweaked by a couple of people on
 Usenet, then completely overhauled by Rich $alz (@email{rsalz@@bbn.com})
 and Jim Berets (@email{jberets@@bbn.com}) in August, 1990.  Various
 revisions for the @sc{gnu} system were made by David MacKenzie, Jim Meyering,
-and others.  The code was rewritten again in 1999 by Paul Eggert,
-to improve its support for daylight saving time.
+Paul Eggert and others.
 
 @cindex Pinard, F.
 @cindex Berry, K.
This page took 0.028687 seconds and 4 git commands to generate.