Hey Guys,
I'm working on a little personal project which needs to do some date comparisons. I'm using strtime to compare two dates. The problem is that the one of the date's is in an unusual format, with MMM/dd/YYYYY. Im wanting to determine whether this date in the above format is more than a week away. This is what I have, it's wrong because it doesn't work 🙂
<?
$stamp1 = "Jun/20/2009";
$time = strftime("%b/%d/%G",strtotime($stamp1));
$stamp2 = strtotime('next week');
if($time > $stamp2) {
echo "this date is more than a week away";
}
else {
echo "wihtin a week";
}
?>
It'd be great if I didnt need to write up an array whcih converts 'Jun' to 06 for every month. ie $date = array(Jun => '06');
Any suggestions appreciated.
Stew