I needed to set the timezone for a group of calendar related scripts that run on a server in the mid-west (USA) because it's a Calendar of Events on a website near Boston, MA (USA).
WebmasterWorld to the rescue! Since the site is on a shared server, it meant figuring how to set the timezone in the scripts
(instead of just setting the time on the server). I didn't want to play around with adding hours or seconds to 'localtime',
(and risk needing to account for and test for dates, years or leapyear type situation that might occur), so I read the perldoc and a few examples that mentioned setting the 'TZ'
ENVironment variable.
But all the examples I found were overly complicated, and none had the exact syntax for setting "Eastern Standard Time" and accounting for annual changes to "Eastern Daylight Savings Time".
So I did one more search for:
perl $ENV{TZ} ...and what pops up? A WebmasterWorld thread from 2005 -- and of course it had simple, clear examples of the (4) US time zones and Greenwich Mean Time!
$ENV{'TZ'} = 'GMT0GMT';
$ENV{'TZ'} = 'EDT5EST';
$ENV{'TZ'} = 'CDT6CST';
$ENV{'TZ'} = 'MDT7MST';
$ENV{'TZ'} = 'PDT8PST';
[webmasterworld.com...]
I cut and pasted the line I needed into the scripts, and easy-peesy, it worked ba-geezy!
Thank you WebmasterWorld, now I know why I hang around here.
(This has been an unsolicited testimonial. I am not a paid endorser, out of work B-list actor, or retired boxer with tax problems. I have not received any compensation for posting this message.)