Page 1 of 1

strtotime returns Integer and Boolean?

Posted: Mon Feb 14, 2011 10:46 pm
by aliases
First post. Racking my brains on this one.

$listing_expiration is a mysql date field
$todays_date = date("m-d-Y");
$today = strtotime($todays_date);
$exp_date = strtotime($listing_expiration);
echo gettype($exp_date)
gettype($today);
} return integer & boolean therefore comparison fails.

Any ideas?

--
Michael

Re: strtotime returns Integer and Boolean?

Posted: Tue Feb 15, 2011 12:28 am
by requinix
strtotime() can't interpret m-d-Y format.

Compare time and strtotime($listing_expiration).

Re: strtotime returns Integer and Boolean?

Posted: Tue Feb 15, 2011 9:37 am
by John Cartwright
Just FYI, strtotime() returns boolean false when it fails to determine the timestamp of the given date string.