PDA

View Full Version : PHP: Date manipulation using timestamp


KevinM
10-25-2005, 11:13 AM
I am using the timestamp taken from the vb's post table and need to establish if this timestamp is more than 14 days old. Any ideas on what this might look like (using PHP)? e.g. using get_date() function or mktime()?

filburt1
10-25-2005, 02:52 PM
$days = 60 * 60 * 24 * 14; // seconds * minutes * hours * days
if ($dateline < time() - $days)
{
...
}

KevinM
10-25-2005, 03:49 PM
Thanks, that is excellent. I had been going down the wrong track completely on this one.

The world needs more ironic moderators ;)