How to find 1 day ago time in PHP microtime()
format.
I am trying like this. But still showing the current time.
$date = date("Y-m-d H:i:s", strtotime('-1 day'));
$val = microtime($date);
How to find 1 day ago time in PHP microtime()
format.
I am trying like this. But still showing the current time.
$date = date("Y-m-d H:i:s", strtotime('-1 day'));
$val = microtime($date);
http://us2.php.net/manual/en/function.microtime.php
microtime() returns the current Unix timestamp with microseconds
You can't use microtime() to get a time from the past, since the funtion only works with current date.
Wouldn't this work for you?
$date = strtotime('-1 day');
Edit: Code corrected according to u_mulder's comment.