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 the TZ environment variable and hands you back a timezone string that's suitable for sticking into date(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