Changes for version 0.90 - 2026-06-07
- str2time now accepts a 'timezone' argument: an object with an offset_for_local method used to resolve a parsed local time that carries no UTC designator or numeric offset. A string offset takes precedence; the object is DST-aware. Time::TZif and Time::TZif::POSIX provide suitable objects.
- str2time now accepts a 'timezone_map' argument: a hash mapping timezone abbreviations (e.g. CET, EST) to objects with an offset_for_local method, used to resolve an abbreviation parsed from the string. A map entry takes precedence over a bare 'timezone' object; an abbreviation absent from the map croaks.
- time2str now accepts a 'timezone' argument: an object with an offset_for_utc method used to derive the offset for the given instant (DST-aware), as an alternative to a fixed 'offset'. The two are mutually exclusive.
Documentation
Modules
Leap second table with TAI/UTC conversions
Parse and format date/time strings in multiple standard formats
Gregorian calendar validation and computation
Precompiled regular expressions for date/time formats
Time validation and epoch conversion
Convert captured date/time tokens to semantic values
Binary search and time zone database utilities
TZif timezone file parser with configurable local time resolution
POSIX TZ string parser with configurable local time resolution
Provides
in lib/Time/Str/PP.pm