1
How to check if the time entered in the input is more than 24?
I tried so:
if ((strtotime($hora) > "24:00:00")) {
echo "a hour não pode ser maior que 24";
}
1
How to check if the time entered in the input is more than 24?
I tried so:
if ((strtotime($hora) > "24:00:00")) {
echo "a hour não pode ser maior que 24";
}
0
$strHora = substr("$hora", 0,2); If ($strHora>24){ echo "a hour não pode ser maior que 24"; } mas o correto seria $strHora = substr("$hora", 0,2); If ($strHora>=24){ echo "a hour não pode ser maior que 24"; } já que ninguém diz 24:00:00 e sim zero hora, então no if seria $strHora > 23
ok, more how do I compare 2 dates? like if 10:00 and less than 20:00.
change the time in timestamp
this was not specified in question rs
@Marcelobonifazioi know, the doubt has now arisen hahahah, more vlw
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
it would not be easier to make an explosion in the var delimiting : and check hour, minute and second?
– MarceloBoni
or still use native function
DateTime
?– MarceloBoni
$strHora = substr("$hour", 0,2); If ($strHora>24){ echo "the hour cannot be greater than 24"; }
– user60252
I think you mean more than 11:59:59, if it’s time of day, because after that it’s 12:00... Unless you’re doing "hours counted," like I worked "80 hours this week only". If you can explain which of these is your case then I will create an answer that is correct for your case.
– Guilherme Nascimento
I need to buy 2 hours, ahora with the time that is in the BD format 00:00:00, I need to know if the hour of achievement and smaller.
– Hugo Borges
Friend @leo’s suggestion should work perfectly for your case.
– Rodrigo Jarouche
@Marcelobonifazio can post an example? ai already mark your answer
– Hugo Borges
@Leocaracciolo put with answer for me to score
– Hugo Borges