Re: Why the discrepancy in date?
- From: Nils Kassube <kassube@xxxxxxx>
- Date: Sun, 8 Jan 2012 17:09:48 +0100
Dotan Cohen wrote:
On Sun, Jan 8, 2012 at 14:06, Nils Kassube <kassube@xxxxxxx> wrote:
However, for dates in the past they do not:
✈saturn:~$ date +%s -d 2006-12-31t22:00
1167577200
Interesting - why do you use "t" instead of " " as a separator
between date and time?
Because then I do not need the quotes. It is also ISO standard 8601:
http://en.wikipedia.org/wiki/ISO_8601
Ah, that's the reason - I didn't know about that standard.
So to me it looks like your "t" separator makes the date command
use the time zone UTC+7 intead of your local time zone.
Furthermore, if I specify a time zone together with your "t"
separator, date complains about an invalid date:
~/ > LC_ALL=C date +%s -d "2006-12-31t22:00 UTC"
date: invalid date `2006-12-31t22:00 UTC'
Even specifying UTC (that is the Z timezone) doesn't help:
✈saturn:~$ date +%s -d "2006-12-31 22:00Z"
1167602400
✈saturn:~$ date -d @1167602400
Mon Jan 1 00:00:00 IST 2007
But that looks correct to me - if IST = UTC+2, then "2006-12-31 22:00Z"
is the same as "Mon Jan 1 00:00:00 IST 2007", isn't it?
I do not believe that there should be a difference when using the T
separator.
Agreed, it seems there is a bug in the date command. When it reads that
"t" separator it shouldn't take it as a time zone.
Nils
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- Follow-Ups:
- Re: Why the discrepancy in date?
- From: Marius Gedminas
- Re: Why the discrepancy in date?
- References:
- Why the discrepancy in date?
- From: Dotan Cohen
- Re: Why the discrepancy in date?
- From: Nils Kassube
- Re: Why the discrepancy in date?
- From: Dotan Cohen
- Why the discrepancy in date?
- Prev by Date: Re: Can not install GeForce 9400 GT driver in Ubuntu 11.10
- Next by Date: Re: Can not install GeForce 9400 GT driver in Ubuntu 11.10
- Previous by thread: Re: Why the discrepancy in date?
- Next by thread: Re: Why the discrepancy in date?
- Index(es):
Relevant Pages
|