mysql - convert string time to datetime format in php -


i have been given export of data client has on 1million records in it.

i have written script reads data array , can import of data mysql database, struggling 1 issue.

there 4 columns in db export have been given dates. unfortunatly formatted in words eg "mar 31 2013 01:04:47:687am"

im after php script converts "mar 31 2013 01:04:47:687am" "0000-00-00 00:00:00" (yyyy-mm-dd hh:mm:ss)

any ideas or suggestions?

i believe string t time can handle format, following work:

 $formatteddatestr = date(        "y-m-d h:i:s",        strtotime( "mar 31 2013 01:04:47:687am" ),  ); 

http://php.net/manual/en/function.strtotime.php


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -