coreutils
[Top][All Lists]
Advanced

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

Re: Question on 'date' command: why UTC_sign_number_ is inverted?


From: Pádraig Brady
Subject: Re: Question on 'date' command: why UTC_sign_number_ is inverted?
Date: Sat, 08 Mar 2014 15:11:01 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 03/08/2014 08:49 AM, Masataro Asai wrote:
> Hi, everyone.
> 
> I'm confused by the behavior in the `date` command.
> 
>> [guicho coreutils]$ TZ='Asia/Tokyo' src/date -R --date="2014/1/1"
>> Wed, 01 Jan 2014 00:00:00 +0900
>> [guicho coreutils]$ TZ='UTC+9' src/date -R --date="2014/1/1"
>> Wed, 01 Jan 2014 00:00:00 -0900
>> [guicho coreutils]$ TZ='America/Los_Angeles' src/date -R --date="2014/1/1"
>> Wed, 01 Jan 2014 00:00:00 -0800
>> [guicho coreutils]$ TZ='UTC-8' src/date -R --date="2014/1/1"
>> Wed, 01 Jan 2014 00:00:00 +0800
> 
> Assuming that I live in Japan and I use JST (Japan Standard Time)
>  which is identical to
> (UTC+9)[http://en.wikipedia.org/wiki/Japan_Standard_Time],
> this is not what I expected. The third and fourth case, in PST=US/LA,
> seems odd as well.
> Is this a bug or the intended behavior?
> The machine is running on ubuntu linux 12.04 and I used the latest
> master branch.
> 
> BTW, I found it while I was writing a script that helps me submitting my
> paper in time,
> which get the time in UTC-12.
> Some of you may know, conference paper deadlines are sometimes defined
> with UTC-12
> so that: "If you are in time anywhere on the world, you are in time. "

I think the main confusing here is that for POSIX timezones
you need to do the opposite to standard convention (and date output),
and use TZ=UTC-9 rather than TZ=UTC+9

POSIX timezones are inconsistent and confusing,
so I suggest one sticks to location based zones instead:

http://www.pixelbeat.org/docs/linux_timezones/

thanks,
Pádraig.



reply via email to

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