This page contains a selection of tips for Perl (on Linux and UNIX) that I have collected. It's more of a memo to myself and not intended as a guide or anything. So just see it as notes that I share with whoever is interested.
Perl sub to return the timezone in ±HH:MM format.
use Time::Local; sub retTimezone { my $offset = (&timegm(localtime) - time) / 60; return sprintf("%+03d:%02d", int($offset / 60), $offset % 60); }
The other sub doing the rounds on the web, does not work properly for timezones that are not whole or half hour offsets, like Nepalese time, which is at +05:45.
7is7.com | Software | Otto | Travel Stories | Countdown Clock | Firefox | StatEye
New | About | Contact | Connect | Friends | Promotions | Copyright | Advertise