DateTime::TimeZone::Local::Win32(3pm)

DateTime::TimeZone::Local::Win323pm

Determine the local system's time zone on windows

Usage

  my $tz = DateTime::TimeZone->new( name => 'local' );
  my $tz = DateTime::TimeZone::Local->TimeZone();

Overview

This module provides methods for determining the local time zone on a Windows platform.

How the time zone is determined

This class tries the following methods of determining the local time zone:

•

$ENV{TZ}

It checks $ENV{TZ} for a valid time zone name.

•

Windows Registry

When using the registry, we look for the Windows time zone and use a mapping to translate this to an Olson time zone name.

•

Windows Vista and 2008

We look in "SYSTEM/CurrentControlSet/Control/TimeZoneInformation/" for a node named "/TimeZoneKeyName". If this exists, we use this key to look up the Olson time zone name in our mapping.

•

Windows NT, Windows 2000, Windows XP, Windows 2003 Server

We look in "SOFTWARE/Microsoft/Windows NT/CurrentVersion/Time Zones/" and loop through all of its sub keys.

For each sub key, we compare the value of the key with "/Std" appended to the end to the value of "SYSTEM/CurrentControlSet/Control/TimeZoneInformation/StandardName". This gives us the English name of the Windows time zone, which we use to look up the Olson time zone name.

•

Windows 95, Windows 98, Windows Millenium Edition

The algorithm is the same as for NT, but we loop through the sub keys of "SOFTWARE/Microsoft/Windows/CurrentVersion/Time Zones/"

Releases

2 releases since Debian 5.0 (Lenny); the text changed 1 time.

  1. 5.0
  2. 6.0

Author

Dave Rolsky, <[email protected]>

From libdatetime-timezone-perl 1:1.20-1+2010k in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.