Reputation: 15912
Trying to convert a date format into a MySQL date:
SELECT STR_TO_DATE('8/3/2011 13:30','%m/%d/%Y %h:%i');
but it returns NULL. Note that this similar query works:
SELECT STR_TO_DATE('8/3/2011 13:30','%m/%d/%Y');
Upvotes: 3
Views: 2851
Reputation: 86506
%h
expects a number from 01 to 12. 13 is invalid.
Try %H
or %k
instead. They're for 24-hour times.
Upvotes: 6