Re: time and again
From: James Rogers (jimmaureenrogers_at_att.net)
Date: 12/25/03
- Next message: SeeBelow_at_SeeBelow.Nut: "Re: Ask for help about wait() for several processes in C ,solaris"
- Previous message: Tobias Guggenmoser: "Re: Borland Pascal/Turbo Pascal under WinXP"
- In reply to: Martijn: "Re: time and again"
- Next in thread: Edward G. Nilges: "Re: time and again"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 25 Dec 2003 14:58:27 GMT
"Martijn" <subscription-removethis-101@hot-removethis-mail.com> wrote in
news:3feab0cf$0$328$e4fe514c@news.xs4all.nl:
>> One consideration might be the approach to time taken by Unix boxes.
>> The processor marks time based upon UTC.
>
> Does that imply that every date "exists" and that the difference from
> UTC changes? This would make life a bit easier, but still the
> potential for the off-by-one-hour issue :) But I think it may indeed
> simplify the problem somewhat. Is there a platform independant method
> of acquiring this difference?
Yes. UTC does not deal with Summer time changes. It does need to deal
with leap years.
A platform independent method would involve converting all dates to
a count of the number of seconds since some epoch date. Unix boxes
traditionally use January 1, 1976 as their epoch date. If your
scheduler is only going forward in time from today I would suggest
January 1, 2001 as a good epoch date. This avoids calculations starting
with a leap year. (2000 was a leap year).
Each time zone applied against your time standard needs to specify its
local offset from UTC. If the time zone uses Summer time changes you must
specify the Summer time offset as well as the local date and time of
each change.
This approach allows you to handle additional oddities of time keeping.
For instance, most time zones are a whole number of hours offset from
UTC. Some are a combination of hours and fractional hours offset.
>
>> but that is a bounded problem with a well published
>> algorithm.
>
> Can anybody point me in the direction of such an algorithm? Or does
> anybody have a hint on what search terms I could use? Until now I
> haven't had any luck with Google.
>
You might visit comp.protocols.time.ntp. The people in that group are
well versed in time computation details.
Jim Rogers
- Next message: SeeBelow_at_SeeBelow.Nut: "Re: Ask for help about wait() for several processes in C ,solaris"
- Previous message: Tobias Guggenmoser: "Re: Borland Pascal/Turbo Pascal under WinXP"
- In reply to: Martijn: "Re: time and again"
- Next in thread: Edward G. Nilges: "Re: time and again"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|