1
I’m looking to do a PHP date comparison of the type: if Datastart >= Datatoday + 3 days, do such a thing. Otherwise, do nothing. I tried something like this:
if ((1/86400)*(strtotime($_SESSION['buscaReserva']['dataInicio'])-strtotime(date("d/m/Y"))))>=3) {
// Do something }
else {
// Do nothing }
Both dates are initially in dd/mm/YYYY format. But maybe I can have today’s date in YYYY-mm-dd format. So I may have to do more than one date conversion. For example, 23/06/2015 or 2015-06-23 (today) should be at least three days less than the date of my SESSION (26/06/2015, for example).
HOW DO I DO?
The duplicate didn’t help me. I may have more than one date format and therefore more than one conversion has to be made for days apart.
– Gustavo Hoppe Levin
Convert Mysql date (YYYY/mm/dd h:m:s) to dd/mm/yyyy
– Maicon Carraro
No, Maicon. Nothing from Mysql. And what should be easier is to convert the dd/mm/yyyy date to YYYY-mm-dd from Session and then make a difference.
– Gustavo Hoppe Levin
Gustavo, instead of reading the title of the questions, read the answers.
– Maicon Carraro
Sorry. Only after I saw it was a link.
– Gustavo Hoppe Levin