bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8782: date command


From: Pádraig Brady
Subject: bug#8782: date command
Date: Thu, 02 Jun 2011 13:06:16 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

I'm going with these 3.
It's a bit tricky to align --help and man output,
but this isn't too bad I think.

cheers,
Pádraig.

>From 9a7a5d114388342a86f7dc9ade7f69b70624e3fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <address@hidden>
Date: Thu, 2 Jun 2011 13:00:18 +0100
Subject: [PATCH] doc: add examples to date --help

* src/date.c (usage): Add examples for TZ handling,
and "seconds since epoch" parsing, neither of which
were mentioned in the man page until now.

Suggested-by: Rick Stanley <address@hidden>
---
 src/date.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/date.c b/src/date.c
index 61d4818..6439d16 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);
-- 
1.7.5.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]