with PHP, I want to check if a time is "before 2pm" today

would strtotime allow something like that, or would a combination of other time/date functions get me this outcome

how would it be done?

I was thinking something like

if(savedTime < strtotime("before 2pm today"))

but it seems the statement isnt that good, ultimately I need both variables to be in unix/epoch time and the comparison itself will be simple, but I don't know how to get the current day's 2pm

有帮助吗?

解决方案

You're almost there:

if($savedTime < strtotime("2pm"))
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top