TDcal::timezone(3) FreeBSD Library Functions Manual TDcal::timezone(3)

TDcal::timezone
TDcal Perl programming library

use TDcal::timezone;


$tz =
tzmstoolson($tzms);

$tz =
tzname();

$tz =
tzvalid($tz);

TDcal::timezone provides support functions for timezone lookup, name validation and name conversion.

In these functions, all $tz arguments and return values have the form of a string containing an Olson standard timezone name such as: ‘America/New_York’, ‘Europe/Paris’ or ‘Asia/Bangkok’, etc.

tzmstoolson() is used to convert the wild and wonderful timezone names often received from Microsoft calendar users into standard Olson timezone names.

tzname() returns the system timezone name. This is determined by examining in order:

  1. The user's TZ environment variable.
  2. The contents of the /etc/timezone file.
  3. The value of a ‘TZ=’ variable in the /etc/TIMEZONE file.
  4. The name pointed to by /etc/localtime if it is a symbolic link.
  5. The zoneinfo database file matching /etc/localtime if it is not a symbolic link. Note that this may return a name other than the expected local zone name as many zones sharing a common definition are linked together in the Olson sources for the zoneinfo database.

Names found are validated to ensure they exist in the zoneinfo database and are skipped if they do not. tzname() returns ‘undef’ if no valid timezone name can be identified.

tzvalid() is used to validate that a timezone name exists in the zoneinfo database. It returns the input value if valid, else ‘undef’.

Return values are as documented above.

TDcal(3), TDcal(7).

The following environment variables affect the operation of TDcal::timezone:
Can be used to override the system timezone.

See TDcal(7).

See TDcal(7).
December 3, 2022 FreeBSD 13.1-RELEASE-p3