Daylight saving time methods?

Daylight saving time methods?

Post by Zack » Wed, 17 Oct 2001 00:31:18

Hello all,

Does any one know a method under IRIX that would get the current year
Daylight saving date?

Thank you.


Daylight saving time methods?

Post by Logan Sh » Wed, 17 Oct 2001 05:58:10

>Does any one know a method under IRIX that would get the current year
>Daylight saving date?

One way is to call time() and record the result.  Then call localtime()
on the result and record the hour/minute.

Then add 86400 (== 24 * 60 * 60) to the time, call localtime() again,
and see if the hour/minute changed.  Stop if either it did change
or the year changed.

If the year changed first, start at the initial point again but try
subtracting 86400 repeatedly instead (in other words, go backwards from
the current date instead of forwards).

Unfortunately, this does not tell you on what day the time change
happens.  It just tells you some 24-hour period during which it
happens.  But you can do a sort of modified binary search to find the
exact time.  You'd pick a time before the time change and two offsets
to add to it (one is zero and the other is 86399); then you do a binary
search for the right offset.

A further difficulty is that the time changes more than once in a year,
and it's at least possible that it might change more than twice.

  - Logan
"In order to be prepared to hope in what does not deceive,
 we must first lose hope in everything that deceives."

                                          Georges Bernanos


1. Daylight Saving Time

Does anyone have a shell script which can be used to determine the date on
which the shift between standard time and daylight time will occur? What I
want to be able to do is run the script and have it return a default
machine-readable date (i.e. YYYYMMDD) of the date that the shift will occur
with an optional switch which will return the number of days until the next
shift occurs. Thus, if it is run on the Sunday that occurs just one week
prior to the shift the return value will be 7. If it is run on the day that
the shift occurs it would return approximately 180 days.

2. Installation - Best Apps

3. Problems with daylight saving time

4. A different weird font problem

5. Help with Daylight saving time...

6. lilo dual boot woes

7. Changing to Daylight Saving TIme

8. can't detect Winfast GeForce 2 MX?

9. ctime() problem with daylight saving time?

10. New daylight saving time code for SunOS 4.x?

11. How to set correct time: GMT vs. Daylight Saving?

12. daylight saving time

13. Daylight Saving Time