[LA.pm] OT: changing the date timezone for perl use

David Pisoni dpisoni at shopzilla.com
Thu Jun 23 11:14:20 PDT 2005


On Jun 23, 2005, at 10.50, Geoffrey Young wrote:

>
>
> Peter Scott wrote:
>> At 09:05 AM 6/23/2005, David Heayn wrote:
>>
>>> I have an ultra simple perl script that requests the current
>>> date/time from a shared server (not mine) then spits out the html
>>> dressing.
>>>
>>> My problem is the server is set to Pacific time and I need Eastern 
>>> time.
>>>
>>> Anyone have any suggestions/alternative server time mechanisms. I'd
>>> rather not go in and program a complete time zone remapping function.
>>
>>
>> Um, since eastern time is always 3 hours ahead of pacific
>
> that's not entirely true - daylight savings starts/ends at 2am local 
> time on
> the days that it switches, so 1:59am EST magically becomes 3am EDT 
> while it
> went from 10:59pm to 11:00pm PST, thus leaving a 4 hour difference for 
> the
> next 3 hours.
>
> madness :)
>
> --Geoff

Hence the reason for using the system-supplied zone info records.  It 
manages DST issues.  This scenario can be even more complex – consider 
that all US locales (that use daylight savings) switch their clocks at 
2.00 local time, but all European locales (again, that use DST) switch 
their clocks at the SAME time globally (1.00 UTC.)  Simply adding or 
subtracting hours just won't cut it!

Enjoy,

David Pisoni
dpisoni at shopzilla.com
Director, Web Engineering
Shopzilla, Inc. <http://www.shopzilla.com/>

"Education is a progressive discovery of our own ignorance."
-Will Durant, historian (1885-1981)



More information about the Losangeles-pm mailing list