Date bug?
Johnny Rosenberg
gurus.knugum at gmail.com
Sat Oct 12 19:13:53 UTC 2013
2013/10/12 Nils Kassube <kassube at gmx.net>
> Johnny Rosenberg wrote:
> > $ date -d @0 +%s
> > 0
> > $
> >
> > Correct. ”%c” means, according to the man pages, ”seconds since
> > 1970-01-01 00:00:00 UTC”.
> >
> > Now:
> > $ date -d @0 +'%F %T'
> > 1970-01-01 01:00:00
> > $
> >
> > Is this correct? Is ”1970-01-01 01:00:00” the same as ”1970-01-01
> > 00:00:00 UTC”?
> >
> > Is my locale settings involved somehow? I live in Sweden which is
> > UTC+01:00, and we have summer time (DST) right now. My guess is that
> > what I see in my examples above is the UTC+01:00 thing.
>
> Why don't you try "date -d @0"? Then you would see that the output is in
> CET which would be the correct time for your time zone at the given
> date. If you need UTC, you could add the -u option.
>
~$ date -d @0
torsdag 1970-01-01 01:00
~$ date -ud @0
torsdag 1970-01-01 00:00
~$
Thanks, the -u thing was what I was looking for. I guess I just didn't
understand it at first.
Johnny Rosenberg
>
>
> Nils
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20131012/a19968d9/attachment.html>
More information about the ubuntu-users
mailing list