On Wed, 07 Jul 2004 12:34:55 -0700, Purl Gurl wrote:
<SNIP>
int time / 86400 = 12606
time / 86400 = 12606.8128240741
You boys are about a day behind us girls, plus or minus a wink or two.
Actually, how would one know if a leap second [ 23 of them since 1970, as
per
ftp://maia.usno.navy.mil/ser7/tai-utc.dat ] is missed on a system,
unless you have a way to compare its notion of "now" with some other
systems notion of "now".
At any rate, the "half-day" is more the result of your local timezone, for
time() returns the number of seconds in the epoch, which for most (but not
all) systems is midnight UTC on Jan 1, 1970 [ Dec 31, 1969 19:00
US/Eastern ]. So:
int time / 86400
will return the number of days (UTC) in the current epoch, which may or
may not be the number of days since Jan 1, 1970. Also, the number of days
will change at midnight UTC, which happens to be at 5am EST (4am EDT) for
where I am sitting. This may or may not be a problem for the originator of
this thread.
Take a look at the DateTime family of modules: its julian day functions
may give you what you need.