Domanda

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

È stato utile?

Soluzione

You're almost there:

if($savedTime < strtotime("2pm"))
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top