FROM : Sean McBride
DATE : Wed Apr 06 16:03:44 2005
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_removed>
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
DATE : Wed Apr 06 16:03:44 2005
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_removed>
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
| Related mails | Author | Date |
|---|---|---|
| Simon Liu | Apr 6, 14:11 | |
| Simon Liu | Apr 6, 15:49 | |
| Sean McBride | Apr 6, 16:03 | |
| Simon Liu | Apr 6, 18:58 | |
| Sean McBride | Apr 7, 02:18 | |
| Simon Liu | Apr 7, 12:03 |






Cocoa mail archive

