PHP& Code Snippets27 Mar 2005 09:11 am
floor and time - calculate number of days elapsed from timestamp
/* web convert date to unix_timestamp: www.4webhelp.net/us/timestamp.php */
One can create their own unix_timestamp converter using mktime() function.
// subtract old timestamp
$t_sec = time() - 1102971600;
/*
divide #seconds by 60 for minutes
divide #of minutes by 60 for hours
divide #of hours by 24 for days
use floor to get integer for day
*/
$t_day = floor(($t_sec / 60) / 60 / 24);