strtotime returns Integer and Boolean?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
aliases
Forum Newbie
Posts: 1
Joined: Mon Feb 14, 2011 10:35 pm

strtotime returns Integer and Boolean?

Post 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
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: strtotime returns Integer and Boolean?

Post by requinix »

strtotime() can't interpret m-d-Y format.

Compare time and strtotime($listing_expiration).
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: strtotime returns Integer and Boolean?

Post by John Cartwright »

Just FYI, strtotime() returns boolean false when it fails to determine the timestamp of the given date string.
Post Reply