> now I'm confused ...
my ($isdst) = ( localtime() ) [8];
my ($mday, $mon, $year, $prev_isdst) = (localtime(time - 60 * 60 * 24) )[
3,4,5, 8];
printf("%d/%02d/%02d\n", $year + 1900, $mon + 1,
$isdst == $prev_isdst ? $mday
: $isdst > $prev_isdst ? (localtime($t - 60 * 60 * 23) )[ 3]
: (localtime($t - 60 * 60 * 25) )[ 3]
);
The idea is, when DST starts/stops, it'll be different than 24 hours ago.
Depending upon which way it changed (the values are 1 and zero) we either
need to subtract 23 hours or 25 hours to be correct. I think.
Yes, this is why modules are a better idea. There are places where, alas,
you can't get those modules (for instance, our production box) or are
otherwise limited.
a
-------------------
Andy Bach
Systems Mangler
Internet: [EMAIL PROTECTED]
Voice: (608) 261-5738 Fax: 264-5932
When I retire, I'm going to spend my evenings by the fireplace, going
through those boxes. There are things in there that ought to be burned.
Richard Millhouse Nixon (Parade magazine)
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs