Does any one know a method under IRIX that would get the current year
Daylight saving date?
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.
"In order to be prepared to hope in what does not deceive,
we must first lose hope in everything that deceives."
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.