unable to get difference between time
-
i have a datetime picker with save as timestamp set to yes.
i m trying to get the difference between the datetime set in the post andthe current datetime but i keep getting error diff() on no object..
$date1=new DateTime(); $format="d/m/Y H:m:s"; $date2= get_field('expirydate'); $date2=date_i18n($format,$date2); $date1==date_i18n($format,$date1); $difference = $date2->diff($date1); $timeleft=$difference->format('%d:%h:%i:%s'); echo $timeleft;
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘unable to get difference between time’ is closed to new replies.