NAME

DateTime::TimeZone::HPUX - Handles timezones defined at the operating system level on HP-UX

VERSION

Version 1.00

SYNOPSIS

On an HP-UX system:

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

my $tz_paris = DateTime::TimeZone::HPUX->new(name => 'MET-1METDST');

DESCRIPTION

This distribution implement detection of the local timezone as defined at the operating system level, either in $ENV{TZ} or in /etc/TIMEZONE.

HP-UX has its own system for defining timezones. See tztab(4). This is incompatible with the now common set of timezones known as the Olson DB that is used by DateTime::TimeZone. This module fixes this hole by providing the map between the two systems.

IMPLEMENTATION

We are using the mapping provided by HP embedded in the Java Runtime Environment:

  • this is the only such map available on HP-UX (the other map I know in /etc/dce_config doesn't uses Olson names)

  • we don't need to bundle our own map that could become obsolete

  • Java is supported by HP, so updated (at least patches are available), so if the local Java has effectively been updated by the lazy administrator (yes, I'm dreaming) DT::TZ::HPUX just has to be reinstalled (force install) and you are not dependent on a new release from its maintainer.

We are using the JRE at the module build time to generate a static Perl package DateTime::TimeZone::HPUX::JavaMap that contains a map of the known timezones defined system wide (/usr/lib/tztab) to Olson DB style timezone names that are known to Java and DateTime::TimeZone.

This extraction is done once for all at install time because JVM startup is SLOOOOOW...

CAVEATS

  • The module build uses a Java Runtime Environment if it finds one. This JRE must be updated to the latest version with HP's patches for accurate results. If a JRE is not found, a default map will be used but it may not be up to date. If you find mapping problems, first update your JRE and rebuild DT::TZ::HPUX with the environment variable JAVA_HOME pointing to it.

  • The module build use the JAVA_HOME environment variable as the prefered JRE to use. Check that it is pointing to the latest JRE on the machine.

  • If you update the JRE, a new timezone mapping may be available. Security fixes and timezone information updating are the most common cause of the publishing of a new JRE. So reinstalling DateTime::TimeZone::HPUX is advised if you update the JRE.

  • The JRE may also be used at runtime in extreme cases:

    -

    TZ environment variable is not set and /etc/TIMEZONE is not available as a fallback. The fix is to set $ENV{TZ}.

    -

    the sources above are avaiable, but have a value that was unknown at the module build time (check DateTime::TimeZone::HPUX::JavaMap). The fix is to rebuild and reinstall the module (cpan force install DateTime::TimeZone::HPUX).

SEE ALSO

BUGS

No known bug at this time. The module has an extensive test suite.

Please report any bugs or feature requests to bug-datetime-timezone-hpux at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DateTime-TimeZone-HPUX. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc DateTime::TimeZone::HPUX

You can also look for information at:

AUTHOR

Olivier Mengué, <dolmen at cpan.org>

COPYRIGHT & LICENSE

Copyright 2009 Olivier Mengué, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.