Pergunta

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

Foi útil?

Solução

You're almost there:

if($savedTime < strtotime("2pm"))
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top