This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: TZ=CEST not detected


[Moving this reply to the cygwin list from cygwin-apps, where I'm not
subscribed and so can't post, since it was only on the -apps list due to an
autocomplete bug by the original poster in the first place.]

Reini Urban writes:
> 2010/3/1 Samuel Thibault:
> >
> > Apparently this one is valid and has a sane meaning:
> >
> > $ TZ=CET-1CEST date
> > lundi 1 mars 2010, 11:46:42 (UTC+0100)
> > $ TZ=CET-1CEST date -d 20090701
> > mercredi 1 juillet 2009, 00:00:00 (UTC+0200)
> >
> > i.e. it switches between CET and CEST as appropriate.

> Great, thanks!

Actually, this is almost certainly not what you want.

"CET-1CEST" means "A time zone one hour east of UTC, named 'CET', with
a one-hour Summer Time using the default rules, named 'CEST'."

Unfortunately, the default rules are the U.S. rules.  Thus:

$ TZ=CET-1CEST date -d "15 mar 2010"
Mon Mar 15 00:00:00 CEST 2010

The U.S. switches to daylight-saving time on Sunday, 14 March this year,
whereas the E.U. switches to summer time on Sunday, 28 March.

The "CET" zone actually does the right thing for summer time, going forward
(using the EU rules):

$ TZ=CET date -d "15 mar 2010"
Mon Mar 15 00:00:00 CET 2010

$ TZ=CET date -d "29 mar 2010"
Mon Mar 29 00:00:00 CEST 2010

Historical times prior to the adoption of E.U. rules (in 1977 or
thereabouts) may be incorrect, however.

To pick the proper time zone name for your region, run the
/usr/sbin/tzselect tool.  Based on your e-mail address, I'd suspect you want
"Europe/Vienna".

-- 
Jonathan Lennox
lennox at cs dot columbia dot edu

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]