doc: add examples to date --help
authorPádraig Brady <P@draigBrady.com>
Thu, 2 Jun 2011 12:00:18 +0000 (13:00 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 9 Jun 2011 14:07:42 +0000 (15:07 +0100)
* src/date.c (usage): Add examples for TZ handling,
and "seconds since epoch" parsing, neither of which
was mentioned in the man page until now.
* THANKS.in: Add Rick.
Suggested by Rick Stanley.

THANKS.in
src/date.c

index ec97e9c..3019f4f 100644 (file)
--- a/THANKS.in
+++ b/THANKS.in
@@ -490,6 +490,7 @@ Richard J. Rauenzahn                rrauenza@hairball.cup.hp.com
 Richard Neill                       rn214@hermes.cam.ac.uk
 Richard Sharman                     rsharman@magmacom.com
 Rick Sladkey                        jrs@world.std.com
+Rick Stanley                        rstanley@rsiny.com
 Rik Faith                           faith@cs.unc.edu
 Risto Kankkunen                     kankkune@lingsoft.fi
 Rob Wortman                         wyrm@haell.com
index 61d4818..6439d16 100644 (file)
@@ -236,6 +236,18 @@ then an optional modifier, which is either\n\
 E to use the locale's alternate representations if available, or\n\
 O to use the locale's alternate numeric symbols if available.\n\
 "), stdout);
+      fputs (_("\
+\n\
+Examples:\n\
+Convert seconds since the epoch (1970-01-01 UTC) to a date\n\
+  $ date --date='@2147483647'\n\
+\n\
+Show the time on the west coast of the US (use tzselect(1) to find TZ)\n\
+  $ TZ='America/Los_Angeles' date\n\
+\n\
+Show the local time for 9AM next Friday on the west coast of the US\n\
+  $ date --date='TZ=\"America/Los_Angeles\" 09:00 next Fri'\n\
+"), stdout);
       emit_ancillary_info ();
     }
   exit (status);