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.
