summaryrefslogtreecommitdiff
path: root/src/date.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2011-06-02 13:00:18 +0100
committerPádraig Brady <P@draigBrady.com>2011-06-09 15:07:42 +0100
commit77d41d2e20fe18fc5830a6601680751209dddb33 (patch)
treec0063876f209c5057bbf80d3899ba9150dcaf66c /src/date.c
parentc2b25223c13ad7bb55bebbdf456a9040c030d10c (diff)
downloadcoreutils-77d41d2e20fe18fc5830a6601680751209dddb33.tar.xz
doc: add examples to date --help
* 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.
Diffstat (limited to 'src/date.c')
-rw-r--r--src/date.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/date.c b/src/date.c
index 61d481827..6439d165a 100644
--- a/src/date.c
+++ b/src/date.c
@@ -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);