I am trying to test whether the current time is past noon on the current day, but a call to strtotime does not return the value I expect.
CODE
$time=strtotime("12:00 PM TODAY");
echo date('h:i:s A',$time);
OUTPUT
12:00:00 AM
You have it in the wrong order. You need the day, then the time:
$time=strtotime("TODAY 12:00 PM");
echo date('Y-m-d H:i:s', $time); // 2020-02-25 12:00:00
See https://www.php.net/manual/en/datetime.formats.relative.php :
Relative statements are always processed after non-relative statements. This makes "+1 week july 2008" and "july 2008 +1 week" equivalent.
Exceptions to this rule are: "yesterday", "midnight", "today", "noon" and "tomorrow". Note that "tomorrow 11:00" and "11:00 tomorrow" are different. Considering today's date of "July 23rd, 2008" the first one produces "2008-07-24 11:00" where as the second one produces "2008-07-24 00:00". The reason for this is that those five statements directly influence the current time.