How to turn Y-m-d to Unix midnight timestamp into PHP?

Asked

Viewed 35 times

-2

Good afternoon,

I need to convert the data from a form that comes in the format ex: 2018-02-13 for UNIX at midnight. If I convert normally using strtotime it comes right but with the time of 6:00AM.

Can someone shed some light? Thank you =)

  • $unixMeiaNoite = strtotime($dataFormulario." 00:00:00");

  • That midnight is confusing. Midnight of the day 2018-02-13 is the next second after 2018-02-13 23:59:59, that is to say 2018-02-14 00:00:00

1 answer

0

Solved, $check_in = strtotime('-6 hour' , strtotime($Arrival));

Browser other questions tagged

You are not signed in. Login or sign up in order to post.