I attempted this:
$date_string = strtotime('6 Mar, 2011 23:59:59');
But I think PHP can't interpret that for some reason as it returned empty. I tried this:
$date_string = strtotime('6 Mar, 2011 midnight');
The above worked but I need it to be a second before midnight i.e. the last second of the day. How can I get strtotime to return this without changing the 6 Mar, 2011 part?
Hope this helps. I used this and it gives todays timestamp just before midnight. Counter intuitive.
$today_timestamp = strtotime('tomorrow - 1 second');
It works for me if I use March 6, 2011 23:59:59
. Any chance of changing the input format?
Other than that, you could of course subtract 1 second from the timestamp. Note however that you need to use March 7:
$date_string = strtotime('7 Mar, 2011 midnight') - 1;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With