{"id":20550233,"url":"https://github.com/dnmfarrell/time-tzfile","last_synced_at":"2026-04-17T08:32:12.715Z","repository":{"id":56836194,"uuid":"56324060","full_name":"dnmfarrell/Time-Tzfile","owner":"dnmfarrell","description":null,"archived":false,"fork":false,"pushed_at":"2016-06-07T22:10:39.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T16:49:22.279Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dnmfarrell.png","metadata":{"files":{"readme":"README.pod","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-15T13:57:13.000Z","updated_at":"2016-04-15T14:00:05.000Z","dependencies_parsed_at":"2022-09-07T07:10:45.146Z","dependency_job_id":null,"html_url":"https://github.com/dnmfarrell/Time-Tzfile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2FTime-Tzfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2FTime-Tzfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2FTime-Tzfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnmfarrell%2FTime-Tzfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnmfarrell","download_url":"https://codeload.github.com/dnmfarrell/Time-Tzfile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242157180,"owners_count":20081036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T02:23:58.718Z","updated_at":"2026-04-17T08:32:12.650Z","avatar_url":"https://github.com/dnmfarrell.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"=pod\n\n=encoding UTF-8\n\n=head1 NAME\n\nTime::Tzfile - read binary tzfiles into Perl data structures\n\n=head1 VERSION\n\nversion 0.03\n\n=head1 SYNOPSIS\n\n  use Time::Tzfile;\n\n  # get 64bit timestamps if available\n  my $tzdata = Time::Tzfile-\u003eparse({filename =\u003e '/usr/share/zoneinfo/Europe/London'});\n\n  # always get 32bit timestamps\n  my $tzdata = Time::Tzfile-\u003eparse({\n    filename        =\u003e '/usr/share/zoneinfo/Europe/London',\n    use_version_one =\u003e 1,\n  });\n\n  # get an unassembled raw parse of the file\n  my $tzdata = Time::Tzfile-\u003eparse_raw({\n    filename =\u003e '/usr/share/zoneinfo/Europe/London'});\n\n=head1 METHODS\n\n=head2 parse ({filename =\u003e /path/to/tzfile, use_version_one =\u003e 1})\n\nThe C\u003cparse\u003e takes a hashref containing the filename of the tzfile to open\nand optionally a flag to use the version one (32bit) tzfile entry. Returns an\narrayref of hashrefs:\n\n  {\n    epoch   =\u003e 1234566789, # offset begins here\n    offset  =\u003e 3600,       # offset in seconds\n    type    =\u003e GMT,        # official abbreviation\n    is_dst  =\u003e 0,          # is daylight saving bool\n  }\n\nTzfiles can have two entries in them: the version one entry with 32bit timestamps\nand the version two entry with 64bit timestamps. If the tzfile has the version\ntwo entry, and if C\u003cperl\u003e is compiled with 64bit support, this method will\nautomatically return the version two entry. If you want to force the version one\nentry, include the C\u003cuse_version_one\u003e flag in the method arguments.\n\nSee L\u003c#SYNOPSIS\u003e for examples.\n\nN.B. AFAIK all binary tzfiles are compiled with UTC timestamps, so this method\nignores the leap, GMT and STD time entries for calculating offsets. If you\nwant to include them, use L\u003c#parse_raw\u003e as an input to your own calculations.\n\n=head2 parse_raw ({filename =\u003e /path/to/tzfile, use_version_one =\u003e 1})\n\nThis method reads the binary file into an arrayref of arrayrefs. Use this if\nyou'd like to inspect the tzfile data, or use it as an input into your own\nprograms.\n\nThe arrayref looks like this:\n\n  [\n    header          # version and counts for the body\n    transitions     # historical timestamps when TZ changes occur\n    transition_idx  # index of ttinfo structs which apply to transitions\n    ttinfo_structs  # gmt offset, dst flag \u0026 the tz abbrev idx\n    tz_abbreviation # tz abbreviation string (EDT, GMT, BST etc)\n    leap_seconds    # timestamp \u0026 offset to apply leap secs\n    std_wall        # arrayref of std wall clock indicators\n    gmt_local       # arrayref of gm local indicators\n  ]\n\n=head1 SEE ALSO\n\n=over 4\n\n=item * L\u003cDateTime::TimeZone\u003e - automatically uses text versions of the Olsen db to calculate timezone offsets\n\n=item * L\u003cDateTime::TimeZone::Tzfile\u003e - applies TZ offsets from binary tzfiles to DateTime objects\n\n=item * L\u003cTime::Zone::Olson\u003e - another module for parsing Tzfiles\n\n=back\n\n=head1 TZFILE FORMAT INFO\n\nI found these resources useful guides to understanding the tzfile format\n\n=over 4\n\n=item * Tzfile L\u003cmanpage|http://linux.die.net/man/5/tzfile\u003e\n\n=item * Very useful description of tzfile format from L\u003cBloomberg|https://bloomberg.github.io/bde/baltzo__zoneinfobinaryreader_8h_source.html\u003e\n\n=item * Wikipedia L\u003centry|https://en.wikipedia.org/wiki/IANA_time_zone_database\u003e on the TZ database\n\n=back\n\n=head1 AUTHOR\n\nDavid Farrell \u003cdfarrell@cpan.org\u003e\n\n=head1 COPYRIGHT AND LICENSE\n\nThis software is Copyright (c) 2016 by David Farrell.\n\nThis is free software, licensed under:\n\n  The (two-clause) FreeBSD License\n\n=cut\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnmfarrell%2Ftime-tzfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnmfarrell%2Ftime-tzfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnmfarrell%2Ftime-tzfile/lists"}