Also, new DateTime() creates a date/time object which cannot be compared to a string. It may be possible to use this object but it will take a lot more code to extract the string you want from it. I can’t help you with that because I personally use the simpler functions for dates and time rather than using this object.
$date2 = date(“d/m/y”, mktime(0, 0, 0, $tempArr, $tempArr, $tempArr));
You can then perform the strtotime() method to get the difference.
Viewing 3 posts - 1 through 3 (of 3 total)
The topic ‘Comparing Dates’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users