Alaw Guo <[EMAIL PROTECTED]> writes:

> When I give the command:
>
>   date --date="1/1/1970 00:00:`date +"%s"`"
>
> Shouldn't this give me the current time?

The +%s format counts UTC seconds, but you are asking "date" to print
local times.  This may help to explain the other results that you got.

> instead, on a RedHat 9 and a Fedora Core 1 system I get:
>
>   [EMAIL PROTECTED] bin]# date ; date --date="1/1/1970 00:00:`date +"%s"`"
>   Sun Jul 25 12:49:32 PDT 2004
>   Sun Jul 25 20:49:32 PDT 2004

Yes, that looks right for Pacific time (8 hours behind UTC on
1970-01-01).  Although I should mention that that particular syntax
isn't documented and so it isn't really supported....

> and on a Fedora Core 2 system I get:
>
>   [EMAIL PROTECTED] cgi-bin]# date ; date --date="1/1/1970 00:00:`date +"%s"`"
>   Sun Jul 25 12:50:44 PDT 2004
>   Thu Jan  1 00:00:59 PST 1970

I can't reproduce this behavior on my host (Debian GNU/Linux 3.0r1,
coreutils 5.2.1, TZ=America/Los_Angeles).


_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to