[Top][All Lists]

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

Re: date --utc adds 24 hours

From: Paul Eggert
Subject: Re: date --utc adds 24 hours
Date: Sun, 05 Mar 2006 00:36:28 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Craig Lawson <address@hidden> writes:

>   # date +'%z %Z'
>   -0800 PST
>   # date --date='2:50 am PST'
>   Sun Feb 26 02:50:00 PST 2006
>   # date --utc --date='2:50 am PST'
>   Mon Feb 27 10:50:00 UTC 2006
> PST is 8 hours ahead of UTC, so the second result should show "Feb 26".

No, the result is correct.  The --utc option tells "date" to act as if
the current time zone is UTC.  Therefore, when you invoke the second
"date" command, today's date is already February 27, and the --date
string is therefore equivalent to "2:50 am PST 2006-02-27".  The
output string is the correct UTC equivalent of that.

reply via email to

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