List Info

Thread: RE: localtime failing on DST change




RE: localtime failing on DST change
country flaguser name
United States
2007-03-13 09:39:04
 
Hello $Bill,
I love reading your answers to other people's problems.  I
hope I can
help you.
Microsoft announced that there is a patch to the MSVCRT.DLL
which may be
used by the perl executable.
I don't know the windows equivalent to ldd to be sure
MSVCRT.DLL is used
by perl, but if it is, then Microsoft's
KB article number 932950  (URL: http://support
.microsoft.com/kb/932590)
seems directly related to the issue
you describe.

Hope this helps,
Joe Dial
"Long Time Lurker"

-----Original Message-----
From: perl-win32-users-bounceslistserv.ActiveState.com
[mailto:perl-win32-users-bounceslistserv.ActiveState.com]
On Behalf Of
Bill Luebkert
Sent: Tuesday, March 13, 2007 10:25 AM
To: perl-win32-usersactivestate.com
Cc: Jan Dubois
Subject: localtime failing on DST change

My 'localtime' function output doesn't reflect DST since the
Sunday
changeover.

System: XP Pro; Perl B811

The earlier DST change time seems to be picked up OK by
Windoze clock.
There
was some mention of the table changes by Microsoft I believe
and there
is some
info at http://suppor
t.microsoft.com/gp/dst_hu1 based on user type.

GetTimeZoneInformation API call looks OK to me - here's all
the
pertinent
output:

	ActiveTime:
	        '-52588' (BIN)
	DaylightBias:
	        '-60' (DW)
	StandardBias:
	        '0' (DW)
	DaylightName:
	        'Pacific Daylight Time' (SZ)
	StandardStart:
	        '720896' (BIN)
	ActiveTimeBias:
	        '420' (DW)
	Bias:
	        '480' (DW)
	DaylightStart:
	        '196608' (BIN)
	StandardName:
	        'Pacific Standard Time' (SZ)

	GetTimeZoneInformation ret: 2 (Daylight Savings Time)

	UTC bias from localtime: 480

	StandardName: Pacific Standard Time
	SYear: 0
	SMonth: 11
	SDayOfWeek: 0
	SDay: 1
	SHour: 2
	SMinute: 0
	SSecond: 0
	SMilliseconds: 0
	StandardBias: 0

	DaylightName: Pacific Daylight Time
	DYear: 0
	DMonth: 3
	DDayOfWeek: 0
	DDay: 2
	DHour: 2
	DMinute: 0
	DSecond: 0
	DaylightBias: -60

	StandardDate: first Sunday of November at 2
	StandardDate-raw: 0-11-0-1-2-0-0-0
	DaylightDate: second Sunday of March at 2
	DaylightDate-raw: 0-3-0-2-2-0-0-0

However localtime returns the following:

	Perl localtime: Tue Mar 13 05:56:54 2007

Actual time is 06:56 PDT not 05:56 PST.

	GMT  : 54 56 13 13 2 107 2 71 0
	GMT  : yr=2007, mo=3, day=13, hr=13, min=56, sec=54,
DST=no

	Local: 54 56 5 13 2 107 2 71 0
	Local: yr=2007, mo=3, day=13, hr=5, min=56, sec=54, DST=no

Note the isdst field (last element) is set to 0 (off) and
the time is
off
by an hour.

Registry
SYSTEM\CurrentControlSet\Control\TimeZoneInformation
shows
the
following values:

	ActiveTime:
		'-52588' (BIN)
	DaylightBias:
		'-60' (DW)
	StandardBias:
		'0' (DW)
	DaylightName:
		'Pacific Daylight Time' (SZ)
	StandardStart:
		'720896' (BIN)
	ActiveTimeBias:
		'420' (DW)
	Bias:
		'480' (DW)
	DaylightStart:
		'196608' (BIN)
	StandardName:
		'Pacific Standard Time' (SZ)

Microsoft has this info
http://msdn2.microsoft.com/en-us/vstudio/bb264729.aspx

and other Q&A :

	Q: I'm a C++ developer who uses the TZ environment
variable,
what does this
	mean to me?

	A: For customers who rely on the TZ environment variable
for the
DST
	information, they will get outdated DST information for
2007 and
beyond (i.e.,
	they will get DST information according to the previous
system).
Microsoft is
	currently working on a fix for this issue and will post
information about its
	availability on the Visual Studio Support page. In the
interim,
developers are
	advised to test their applications to determine the impact
of
the DST update
	on their applications. This issue is also fixed in Visual
Studio
code name
	"Orcas".
	Support page:
http://msdn2.microsoft.com/en-us/vstudio/aa718682.aspx

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Userslistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Userslistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

Re: localtime failing on DST change
country flaguser name
United States
2007-03-13 11:40:45
Dial, Joe wrote:
>  
> Hello $Bill,
> I love reading your answers to other people's problems.
 I hope I can
> help you.
> Microsoft announced that there is a patch to the
MSVCRT.DLL which may be
> used by the perl executable.
> I don't know the windows equivalent to ldd to be sure
MSVCRT.DLL is used
> by perl, but if it is, then Microsoft's
> KB article number 932950  (URL: http://support
.microsoft.com/kb/932590)
> seems directly related to the issue
> you describe.

I downloaded the fix and it seems to be fixed now although
it took a
bit for the system clock to sync up as DST.

Jan Dubois wrote:
 >
 > This is expected if you have the TZ environment
variable set because
 > Microsoft didn't release an updated MSVCRT.dll.
 >
 > If you don't use TZ, then DST _should_ be correct for
the current year,
 > but wrong for timestamps in the past.

Interesting, if I now unset the TZ ENV vrbl, it still works.
 I guess
the fix E:/Tmp/WindowsXP-KB932590-x86-ENU.exe may have
handled that.

I found this file:
D:/WINDOWS/WinSxS/Manifests/x86_Microsoft.Windows.CPlusPlusR
untime_6595b64144ccf1df_7.0.2600.3085_x-ww_e059201c.Manifest


Which contains:
<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
     <assemblyIdentity type="win32"
name="Microsoft.Windows.CPlusPlusRuntime"
version="7.0.2600.3085"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"/>
     <file name="msvcrt.dll"
hash="d535ee6a5f3709a652b551b32a95c1399f27e8e1"
hashalg="SHA1"/>
     <file name="msvcirt.dll"
hash="f16b3b4d3ae5c9212f538752164bb1f0998e2062"
hashalg="SHA1"/>
</assembly>

And a log file for the KB which contained:
20.235: Copied file:  D:WINDOWSsystem32msvcrt.dll

which looks like a new CRT was downloaded:
-rw-rw-rw-   1 user     group      343040 Feb 19 03:32
msvcrt.dll

So I guess all is well for now.

Thanks to you both for the info.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Userslistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )