Re: Why the discrepancy in date?



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


Relevant Pages

  • Re: So why have sky cut off the major European dealers?
    ... You want to be closer to USA not to Europe that is why you ... UK is on the same longitude as france so there is no reason to have 1 ... You do not want to be a part of anything which may unite europe. ... Check the Time Zone options in your Operating System. ...
    (uk.media.tv.sky)
  • Re: SP2 and August 16th
    ... You have not given any reason at all why Microsoft should start at any ... particular time or Time Zone reference. ... >>>> Automatic Updates to computers not running pre-releases versions ...
    (microsoft.public.windowsxp.general)
  • Re: A cautionary tale about daylight savings time
    ... confused every time it crossed a time zone. ... I didn't think about GPS being GMT, ... totally logical--it's a new toy and my first GPS encounter. ... You can't reason with someone whose first line of argument is ...
    (rec.arts.tv)
  • Re: Everyone having Endless Fun with our MENTALLY RETARDED Resident Psychopath, aka "The Rectum" on
    ... sci and scj and Usenet's famous sexual cripple, FAKING his time zone again, ... There's nothing wrong with suing someone else if there's a good reason. ... It wastes the courts' time, ... Retard. ...
    (uk.rec.driving)
  • Re: Text Message time problem
    ... for some reason the time I recieved them is an hour ahead of ... Is your phone number in a different time zone than you are physically? ... but with a Kansas City phone number. ... Posted via a free Usenet account from http://www.teranews.com ...
    (microsoft.public.pocketpc.phone_edition)