[tz] How to compute the moment of the next DST change

Alan Mintz Alan_Mintz+TZ_IANA at Earthlink.net
Tue Apr 2 17:28:35 UTC 2013


At 2013-04-02 02:23, John Haxby wrote:
>On 02/04/13 09:58, Simon Perreault wrote:
> >
> > I want to write a cron job or similar that activates one week prior to
> > daylight saving time changes. (Or, more generically, one week prior to
> > any time jumps, for any reason, DST or else.)
>...
>
>You can also use localtime(3) with the current time and the current time
>plus 7*24*2600 and compare the tm_hour field.

that would be 7*24*3600 (=7*24*60*60)

(just because nobody mentioned the phreak-slip in follow-up yet :) )

I like the zdump solution, though, since it only needs to be run when the 
tz database is updated, not every hour.

--
Alan Mintz <Alan_Mintz+TZ_IANA at Earthlink.net>



More information about the tz mailing list