PHP mySQL timestamp needs return date as 00:00:00
I want to get time from TIMESTAMP
using php in mySQL
while ($row = mysql_fetch_array($result)) {
$detail["work_time"] = date("H-i-s", strtotime($row["entry_time"]));
}
The entry_time string value is equal 00:00:00 00:00:00
, but when I type $detail["work_time"]
, the result is 01:00:00
. I need a result 00:00:00
. Any help is appreciated.
source to share
You cannot do this. If you have one strtotime()
, you must enter the correct string, which is the number of seconds since January 1, 1970 00:00:00 UTC.
Minimum date January 1 1970 00:00:00 UTC
. If your timezone is +1, the default will be January 1 1970 01:00:00 UTC
. You can check it out: just put d-m-Y
before H-i-s
.
You have to refactor your logic.
source to share