1DateTime::TimeZone::LocUasle:r:WCionn3t2r(i3b)uted PerlDDaotceuTmiemnet:a:tTiiomneZone::Local::Win32(3)
2
3
4
6 DateTime::TimeZone::Local::Win32 - Determine the local system's time
7 zone on Windows
8
10 my $tz = DateTime::TimeZone->new( name => 'local' );
11
12 my $tz = DateTime::TimeZone::Local->TimeZone();
13
15 This module provides methods for determining the local time zone on a
16 Windows platform.
17
19 This class tries the following methods of determining the local time
20 zone:
21
22 · $ENV{TZ}
23
24 It checks $ENV{TZ} for a valid time zone name.
25
26 · Windows Registry
27
28 When using the registry, we look for the Windows time zone and use
29 a mapping to translate this to an Olson time zone name.
30
31 · Windows Vista and 2008
32
33 We look in
34 "SYSTEM/CurrentControlSet/Control/TimeZoneInformation/" for
35 a node named "/TimeZoneKeyName". If this exists, we use
36 this key to look up the Olson time zone name in our
37 mapping.
38
39 · Windows NT, Windows 2000, Windows XP, Windows 2003 Server
40
41 We look in "SOFTWARE/Microsoft/Windows
42 NT/CurrentVersion/Time Zones/" and loop through all of its
43 sub keys.
44
45 For each sub key, we compare the value of the key with
46 "/Std" appended to the end to the value of
47 "SYSTEM/CurrentControlSet/Control/TimeZoneInformation/StandardName".
48 This gives us the English name of the Windows time zone,
49 which we use to look up the Olson time zone name.
50
51 · Windows 95, Windows 98, Windows Millenium Edition
52
53 The algorithm is the same as for NT, but we loop through
54 the sub keys of
55 "SOFTWARE/Microsoft/Windows/CurrentVersion/Time Zones/"
56
58 Dave Rolsky, <autarch@urth.org>
59
61 Copyright (c) 2003-2008 David Rolsky. All rights reserved. This
62 program is free software; you can redistribute it and/or modify it
63 under the same terms as Perl itself.
64
65 The full text of the license can be found in the LICENSE file included
66 with this module.
67
68
69
70perl v5.10.1 2017-03-21DateTime::TimeZone::Local::Win32(3)