[thechat] determining most recent midnight

gozz gozz at gozz.com
Thu Feb 20 21:21:01 CST 2003


Was going to post this to the list, but solved my problem
by converting to a string date w/o the time and then
parsing that back into a unix epoch time ... but ... I can't
figure out what's wrong with the way I was trying to
mathematically figure out when the most recent midnight
was:

$unix_time = seconds since Jan 1, 1970;
$seconds_in_day = 60 * 60 * 24;
$seconds_since_most_recent_midnight = $unix_time %
$seconds_in_day;
$most_recent_midnight = $unix_time -
$seconds_since_most_recent_midnight;

Where do I go wrong there?

PS. Sorry for any mispellings and odd wrapping - I'm on
webmail as I'm using my brand new to me 300MHz /128
MB orange and white iBook with Jaguar, Apache, PHP,
MySQL and BBEdit. It's blazingly fast. At least to me who
just discovered writing code is a lot more fun when
lounging on a luxurious sofa.



More information about the thechat mailing list