convert python string date to mysql datetime -
I have a string field ditch that is a date scrapped from the internet and reads like this:
  "Lunn Ann 27, 2014 9:52 pm", "March 11, 2014 at 5:38 pm", ...    Lun = Day of the week ( lunes / Monday) N = Month (NERO / Jan)  
 I need to enter them into a data time field in a MESPL table.  
  'YYYY-MM-DD HH: MM: SS'    I think this is a very common issue and was wondering if Someone already has a script to do this or can tell where I can see ...  
 Thanks in advance!  
 
   month_f_th_yyre = ['n', 'fur', 'march' arr ',' DEF Convert_to_IIISQLForm (String): Explosive = String, May ',' Jun ',' Jul ',' Oh ',' Sep ',' Akt ',' Nov ',' Dec '] ) Day_of_the_month = Explosion [2] [: - 1] If int (explosion [2] [: - 1]) & lt; 10: day_of_the_month = "% 02d" (explosion [2] [: - 1]), if the explosion [5] == 'am': time_split = explode [4] .split (':') if time_split [0] == '12': Time_split [0] = '00' Alif int (Time_split [0]) & lt; 10: time_split [0] = "% 02d"% int (time_split [0]) other: time_split = explosion [4] .split (':') if int (in time_split [0]) range (1, 12): Time_split [0] = str (int (time_split [0]) + 12) if month_off_the_yire.indx (explosion [1])    2014-01-27 09:52:00 
 2014-01-27 21:52:00   
 
 
Comments
Post a Comment