문제

SELECT UNIX_TIMESTAMP(STR_TO_DATE('2014-05-10 13:12:44','%Y-%m-%d %h:%m:%s'));

returns NULL. Am I missing something? I thought this would return a timestamp.

도움이 되었습니까?

해결책

Your date format string should be '%Y-%m-%d %H:%i:%s'. %m means month, and %h means USA-style 0-12 hours, so 13 is no good.

Using STR_TO_DATE is almost as much fun as whistling into a modem, but not quite. :-)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top