Date help (no not that kind)
| From: | sundogcurt | Date: | Sat, 10 Nov 2001 22:01:55 +0000 |
| Subject: | Date help (no not that kind) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-74127@lists.php.net to get a copy of this message | ||
I am trying to determine if todays date ($today) is within a week ($startcheck) of a given date ($dob). This is what I have so far.
$todaydate = (date("Y-d-m"));
$today = strtotime($todaydate);
// $today prior to strtotime = 2001-10-11
$startcheck = strtotime(2001-08-11);
$dob = strtotime(2001-15-11);
//$today is CLEARLY between the two dates I'm testing with but "no" is always returned.
if($today <= $dob && $startcheck <= $today) {
print "yes";
}
else {
print "no";
}
Here are the values assigned to the vars, why is $today so much smaller than $startcheck and $dob?
1002783600 = today
1005452940 = startcheck
1005451980 = dob
win32 php4
Thanks in advance