Reputation: 5219
I am facing some problem with STR_TO_DATE in mysql. The following is returning NULL.
select str_to_date('2012-04-28 23:00:15', '%Y-%m-%d %h:%i:%s');
What is wrong here?
Upvotes: 0
Views: 254
Reputation: 157
Can use also:
str_to_date('2012-04-28 23:00:15', '%Y-%m-%d %T')
Upvotes: 1
Reputation: 20883
You need capital %H, not a lowercase %h.
%H
%h
According to the docs,
%H Hour (00..23) %h Hour (01..12)
Upvotes: 2