in reply to Is there an official DST border day detection module?
sub today_is_24hours { my $now = 60*60*int( time()/60/60 ); # Start of this hour my $hour = ( localtime($now) )[2]; $now -= $hour*60*60; # Start of this day return ( localtime($now) )[8] == ( localtime($now+24*60*60) )[8]; }
(DST never changes twice in a single day.)
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is there an official DST border day detection module? (localtime)
by flowdy (Scribe) on Oct 28, 2014 at 10:17 UTC | |
by hippo (Archbishop) on Oct 28, 2014 at 11:08 UTC |