Jump to content

[SOLVED] determining the the age of a date


ahs10

Recommended Posts

sorry, i thought i asked this question before, but when i searched the board it didn't come up.  i found that post by doing an advanced search and it was answered in there.  here's the answer i'm using....

 

<?php

 

$post = the-post-date;

$old = date("m-d-Y", strtotime("2 days ago"));

 

if ($post <= $old) {

 

// The post is 2 days old or older

 

} else {

 

//The post is less than 2 days old.

 

}

 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.