Getting a timestamp for today at midnight?

user1701398 picture user1701398 · Oct 29, 2012 · Viewed 138k times · Source

How would I go about getting a timestamp in php for today at midnight. Say it's monday 5PM and I want the Timestamp for Monday(today) at midnight(12 am) which already has happened.

Thank you

Answer

hakre picture hakre · Oct 29, 2012
$timestamp = strtotime('today midnight');

You might want to take a look what PHP has to offer: http://php.net/datetime