delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/05/23:16:51

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <cb51e2e0508052016796b01ce@mail.gmail.com>
Date: Fri, 5 Aug 2005 20:16:37 -0700
From: Joshua Daniel Franklin <joshuadfranklin AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Timezone names
In-Reply-To: <42F22878.7060406@hones.org.uk>
Mime-Version: 1.0
References: <42F22878 DOT 7060406 AT hones DOT org DOT uk>
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id j763GoRP020322

On 8/4/05, Cliff Hones wrote:
> I was curious as to why, under Cygwin, the default UK timezone
> names (eg as displayed by "date") are different from the standard
> names.  [Standard UK names are GMT and BST, while Cygwin displays
> GMTST and GMTDT.]  So I did some source digging.  Forgive me if the
> following info is already readily available - but I couldn't find
> it.  Note that the Cygwin FAQ admits to being out of date:
>    http://cygwin.com/faq/faq_3.html#SEC85


Thanks, Cliff! Do you mind if I use this for the new FAQ text?


> Cygwin does not use the Newlib version of tzset - there is a
> Cygwin-specific implementation in localtime.cc.  Unlike the
> Newlib tzset, if environment TZ is not set, the Cygwin version
> uses Windows API GetTimeZoneInformation.  The timezone names
> as seen by Cygwin are set using just the the capital letters in
> the Windows timezone names  (which, for the UK, are "GMT Standard Time"
> and "GMT Daylight Time").
> 
> Of course, this affets other timezones too; most US zones translate
> to their standard names, but Central America will generate CAST/CADT
> rather than CST/CDT.
> 
> To get the more standard names, one can, of course, set the
> TZ environment variable explicitly (eg to "GMT0BST").  There is
> logic to complement the TZ setting info with default info from
> built in posixrules, but it's not clear to me if this will set the
> daylight saving on/off points correctly.  An alternative solution,
> which will use the Windows daylight saving info as before is to
> update the Windows timezone database directly.  I believe there is
> a "tzedit" tool to do this in Windows resource kits, but it is easy
> to do using the registry [ok, I know this is frowned on].  The timezone
> names (in NT/2K/XP) are in
>    HKLM\Software\Microsoft\Windows NT\Current Version\TimeZones\<yourzone>
> (eg ..\GMT Standard Time for UK).
> The keys "Std" and "Dlt" specify the zone names - I changed mine to
> be "Greenwich Mean Time" and "British Summer Time".  After the change,
> to make it effective, use the Windows "Adjust Date/Time" dialog to reselect
> your timezone.
> 
> OBLIGATORY WARNING - Do not modify registry settings unless you are confident
> you know what you are doing, and know how to restore previous settings if
> your system subsequently malfunctions.
> 
> A possibly better solution, one day, would be for the "localtime" implementation
> to be implemented for Cygwin, with zone files in /usr/share/zoneinfo.
> 
> -- Cliff
> 
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 
>

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019