Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

DateTime::TimeZone::Local::Unix

Name DateTime::TimeZone::Local::Unix
Version 2.51
Located at /usr/share/perl5
File /usr/share/perl5/DateTime/TimeZone/Local/Unix.pm
Is Core No
Search CPAN for this module DateTime::TimeZone::Local::Unix
Documentation DateTime::TimeZone::Local::Unix
Module Details DateTime::TimeZone::Local::Unix


NAME

DateTime::TimeZone::Local::Unix - Determine the local system's time zone on Unix


VERSION

version 2.51


SYNOPSIS

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


DESCRIPTION

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


HOW THE TIME ZONE IS DETERMINED

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

Note: Some systems such as virtual machine boxes may lack any of these files. You can confirm that this is case by running:

    $ ls -l /etc/localtime /etc/timezone /etc/TIMEZONE \
        /etc/sysconfig/clock /etc/default/init

If this is the case, then when checking for timezone handling you are likely to get an exception:

    $ perl -wle 'use DateTime; DateTime->now( time_zone => "local" )'
    Cannot determine local time zone

In that case, you should consult your system man pages for details on how to address that problem. In one such case reported to us, a FreeBSD virtual machine had been built without any of these files. The user was able to run the FreeBSD tzsetup utility. That installed /etc/localtime, after which the above timezone diagnostic ran silently, i.e., without throwing an exception.


SUPPORT

Bugs may be submitted at https://github.com/houseabsolute/DateTime-TimeZone/issues.


SOURCE

The source code repository for DateTime-TimeZone can be found at https://github.com/houseabsolute/DateTime-TimeZone.


AUTHOR

Dave Rolsky <autarch@urth.org>


COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by Dave Rolsky.

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

The full text of the license can be found in the LICENSE file included with this distribution.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026