Or, if you're going to going to be subtracting 24 hours for purposes of getting a name for yesterday's log file, arrange to run your cron(1) job after 3am. At least under the U.S. daylight savings adjustment rules, that'll be safe.
| [reply] [d/l] |
Although the "subtracting hours" method is highly risky, for
a variety of reasons, it does work if you use it within
reason.
It would be highly advisable to subtract 26 hours from
noon on the day in question, which allows for those wacky
time zones which shift 1.5 hours. This should put you at
anywhere from 10am to 12pm on the day prior, depending on
how wacky the time zone in question is. It should never,
though
put you more than a single day back. The UNIX time system
thankfully can't represent time around the Gregorian
Reformation of 1582 which skipped 10 days(!) to make the calendar
Leap Year Compliant.
ObUselessFact:
BTW, there are more than 60 seconds in a minute. Every year
the atomic clock people add or subtract several "leap seconds"
to make sure that noon is noon. This is the fundamental
difference between GMT and UCT (Universal Coördinated Time). With all the water, air,
wind, and tectonic movement, the Earth is not spinning at
a precise rate, and corrections must be made to keep things
exactly on time. However, unless your computer had an
atomic clock in it that was constantly synchronized to UCT, you shouldn't
worry too much about this.
| [reply] |
More trivia: In the CB recently, merlyn mentioned that UCT and GMT now differ by 19 seconds.
| [reply] |