Re: TimeZone trouble

[email protected] (Shane McCarron)
Newsgroups perl.datetime
Message-ID <[email protected]>
Cairo does this too.  I used to use midnight local time to determine 
what 'day' it is.  That would mean the application would fail for an 
hour in some timezones.  I changed to using some other time...  23:58 I 
think.  This might fail somewhere too, but nowhere I have found.

On 9/27/2011 8:21 AM, Zefram wrote:
> Maros Kollar wrote:
>> However i do not know how to prevent my application from failing in
>> Brasil one day a year (or possibly longer) except by stop using the any
>> time zones?!
> You need to approach your problem differently.  Sao Paulo is a nasty
> case because it jumps at midnight, but the same general problem occurs
> in any timezone.  What exactly are you trying to achieve?  None of your
> examples do anything with time of day, so perhaps you're only calculating
> with whole days?  If that's the case, you could use UTC or the floating
> timezone for your date arithmetic.  Or you could pick a time of day that's
> always acceptable in your timezone (noon is a good bet, but there have
> been a handful of offset jumps at local noon).  If you actually care
> about a particular time of day in your local zone, you just have to be
> prepared for that time to not exist, and catch the exception.
>
>> Any suggestions how to work around this issue?
> It all depends on what you're trying to achieve.
>
> -zefram

-- 
Shane McCarron
Managing Director, Applied Testing and Technology, Inc.
+1 763 786 8160 x120
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.