This code:
date_default_timezone_set('Europe/Stockholm');
$time = date('H:m', strtotime('08:00:00'));
echo $time;
Echoes 08:12... why? what am I missing here?
Tried also online at http://writecodeonline.com/php/ with exact this code and got same result. I would expect a error in hours, in case I made something wrong, but 12 minutes seems very strange.
The 08:00:00 value is a example from my database, all times are stored as TIME.
In date format 'm' means month, not minutes. Try to use 'i'. For example:
$time = date('H:i', strtotime('08:00:00'));
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