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'));
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments