yoda699 Posted November 24, 2009 Share Posted November 24, 2009 Hi, I am trying to convert a string to datetime format. Here is my code: SELECT STR_TO_DATE('11/02/2009 01,30,00,am','%m/%d/%Y %r') It doesn't work. Can you please tell me whats wrong with the code? Thanks Link to comment https://forums.phpfreaks.com/topic/182784-help-with-str_to_date/ Share on other sites More sharing options...
Mchl Posted November 24, 2009 Share Posted November 24, 2009 SELECT STR_TO_DATE('11/02/2009 01,30,00,am','%m/%d/%Y %h,%i,%s,%p'); Link to comment https://forums.phpfreaks.com/topic/182784-help-with-str_to_date/#findComment-964770 Share on other sites More sharing options...
yoda699 Posted November 24, 2009 Author Share Posted November 24, 2009 Thanks, Could you please also give me an example of how to use the %r function Link to comment https://forums.phpfreaks.com/topic/182784-help-with-str_to_date/#findComment-964786 Share on other sites More sharing options...
Mchl Posted November 24, 2009 Share Posted November 24, 2009 As explained in manual %r Time, 12-hour (hh:mm:ss followed by AM or PM) Link to comment https://forums.phpfreaks.com/topic/182784-help-with-str_to_date/#findComment-964797 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.