php - Compare given date with today -
i have following
$var = "2010-01-21 00:00:00.0"   i'd compare date against today's date (i.e. i'd know if $var  before today or equals today or not)
what function need use?
strtotime($var);   turns time value
time() - strtotime($var);   gives seconds since $var
if((time()-(60*60*24)) < strtotime($var))   will check if $var has been within last day.
Comments
Post a Comment