Time::Zone(3)
π Time::Zone(3) β the manual page, but make it make sense β¨
okay so bestie, welcome to Time::Zone, a whole little Perl module from the User Contributed Perl Documentation corner of the universe π¦ it's giving "miscellaneous timezone manipulation routines" and honestly? iconic behaviour.
β¨ NAME β¨
Time::Zone β miscellaneous timezone manipulations routines π
like, routines. for timezones. miscellaneous ones. that's the vibe.
πΈ SYNOPSIS πΈ
here's the group chat screenshot of how you actually use it, verbatim, no cap:
use Time::Zone;
print tz2zone();
print tz2zone($ENV{'TZ'});
print tz2zone($ENV{'TZ'}, time());
print tz2zone($ENV{'TZ'}, undef, $isdst);
$offset = tz_local_offset();
$offset = tz_offset($TZ);
look at that. five lines of tz2zone jumpscares and two offset calls. we love a flexible icon π
π DESCRIPTION π
okay so this whole module is literally just a collection of miscellaneous timezone manipulation routines. that's the entire pitch. it's a little grab-bag of timezone besties π«Ά
tz2zone()β parses theTZenvironment variable and hands you back a timezone string that's suitable for sticking intodate(1)-like output π and yeah, it optionally takes a timezone string, a time, and an is-dst flag. three optional args just vibing there. slay.tz_local_offset()β determines the offset from GMT time, in seconds β and here's the lil secret: it only does the calculation once. that's it. one and done. main character energy, no re-runs πtz_offset()β determines the offset from GMT, in seconds, of a specified timezone π so you point at a timezone and it tells you how far from GMT you are, in seconds. numbers. we love numbers.tz_name()β determines the name of the timezone based on its offset π·οΈ offset goes in, a name comes out. reverse-engineering the whole thing fr fr.
ngl there's no deep lore here, it's exactly what it says on the tin β a handful of timezone helpers doing their little jobs π
π AUTHORS π
these absolute legends made it happen, take a bow besties π:
- Graham Barr
<gbarr@pobox.com>π - David Muir Sharnoff
<muir@idiom.com>β¨ - Paul Foley
<paul@ascent.com>π¦
and that's the whole page!! this lil gem shipped as part of perl v5.42.0, dated 2020-05-20, and it's still out here being absolutely fine π
periodt. go parse a TZ variable, you've earned it π«Άπ·
π¦ where this page comes from
- opensuse-leap 16.0: perl-TimeDate 2.33-160000.2.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms