Re: NSCalendarDate, NSTimer - Daylight Saving Time (DST) problem is tricky...
Re: NSCalendarDate, NSTimer - Daylight Saving Time (DST) problem is tricky...
- Subject: Re: NSCalendarDate, NSTimer - Daylight Saving Time (DST) problem is tricky...
- From: "Sean McBride" <email@hidden>
- Date: Wed, 6 Apr 2005 10:03:44 -0400
- Organization: Rogue Research
On 2005-04-06 13:11, Simon Liu said:
>I'm trying to implement a timer based scheduler. When DST ends, how
>does that affect NSTimers? Is there any documentation and specs on
>how NSCalendarDate and NSTimers behave when moving from DST to
>non-DST?
Not that I've seen. I recently had a similar problem:
<http://www.cocoabuilder.com/archive/message/2005/3/31/131858>
My workaround was to also register for a notification for sleep/wake
events and clock change events. Then I readjust my timers. If your
timer was supposed to fire but the machine was asleep your timer is lost.
IIRC, the time change notification is undocumented and you need to use
Carbon, but my code is at home and I'm at work...
>Say you have a timer set to fire at 01:30:00, since it happens twice,
>when should it fire? From some investigation, it seems that with
>NSCalendarDate, 01:30:00 only occurs once, so what happened to the
>second occurence?
NSCalendarDate also has a time zone component, so it should be able to
represent both 01:30s.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden