I am currently trying to get a database transfered from an old system to a new one, and i have run into a small issue.
I have a db row formatted at:
And i cant seem to get it to work through strptime()
Here is what i have:
$format = '%Y-%m-%d %H:%i:%s';
$ct = strptime($row['time'], $format );
//$row['time'] == 2007-01-11 00:47:27
Format should be a bit different:
$format = '%Y-%m-%d %H:%M:%S'; // or just '%F %T'
Here's the corresponding section of
strftime format documentation:
%M Two digit representation of the minute [00 through 59] %S Two digit representation of the second [00 through 59] %T Same as "%H:%M:%S" %F Same as "%Y-%m-%d" (commonly used in database datestamps)