I’m taking a string which represents a time value and am storing it in a database table where the field type is also a time value. The problem is that I try to first format the string to be of a date time format using the code:
date('H:m', strtotime($value));
The issue is that its returning the time but with 8 minutes incremented to it.. I have no idea why is this happening. Im using php MySQL. Help please
Doesn’t the database need it to be in HH:MM:SS (H:i:s) format for a TIME field?
Maybe it is taking HH:MM and trying to fit it into the wrong shaped field.