diff options
author | hobbs <hobbs> | 1999-12-01 00:08:36 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 1999-12-01 00:08:36 (GMT) |
commit | 79bdb822ff78858fd0f4064fdd902ab472562f8e (patch) | |
tree | 9bd881a878bfb4fb72b29a617bd39d432c1dfcc3 /win/tclWinTime.c | |
parent | dad51dd35e51fb99f720f24336f04aacd1aa5d08 (diff) | |
download | tcl-79bdb822ff78858fd0f4064fdd902ab472562f8e.zip tcl-79bdb822ff78858fd0f4064fdd902ab472562f8e.tar.gz tcl-79bdb822ff78858fd0f4064fdd902ab472562f8e.tar.bz2 |
* win/tclWinTime.c: fixed handling of %Z on NT for time zones
that don't have DST.
Diffstat (limited to 'win/tclWinTime.c')
-rw-r--r-- | win/tclWinTime.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/win/tclWinTime.c b/win/tclWinTime.c index de0e3dd..db2affd 100644 --- a/win/tclWinTime.c +++ b/win/tclWinTime.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinTime.c,v 1.4 1999/04/16 00:48:10 stanton Exp $ + * RCS: @(#) $Id: tclWinTime.c,v 1.5 1999/12/01 00:08:43 hobbs Exp $ */ #include "tclWinInt.h" @@ -219,17 +219,20 @@ TclpGetTZName(int dst) Tcl_ExternalToUtf(NULL, NULL, zone, len, 0, NULL, name, sizeof(tsdPtr->tzName), NULL, NULL, NULL); } - if ((name[0] == '\0') - && (GetTimeZoneInformation(&tz) != TIME_ZONE_ID_UNKNOWN)) { + if (name[0] == '\0') { + if (GetTimeZoneInformation(&tz) == TIME_ZONE_ID_UNKNOWN) { + /* + * MSDN: On NT this is returned if DST is not used in + * the current TZ + */ + dst = 0; + } encoding = Tcl_GetEncoding(NULL, "unicode"); Tcl_ExternalToUtf(NULL, encoding, (char *) ((dst) ? tz.DaylightName : tz.StandardName), -1, 0, NULL, name, sizeof(tsdPtr->tzName), NULL, NULL, NULL); Tcl_FreeEncoding(encoding); } - if (name[0] == '\0') { - return "%Z"; - } return name; } |