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 value of row entry_time is 00:00:00 00:00:00 but when I print $detail["work_time"] the result is 01:00:00. I need the 00:00:00 result. Any help is appreciated.
You can't do it. If you have strtotime(), you have to put valid string, which is the number of seconds since January 1 1970 00:00:00 UTC.
The minimum date is January 1 1970 00:00:00 UTC. If your timezone is +1, the full time will be January 1 1970 01:00:00 UTC by default.
You can check it: just put d-m-Y before H-i-s.
You should refactor your logic.
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