PayPal's IPN gives dates in this format 06:52:15 Apr 12, 2014 PDT
which is not a valid recognised format. Also, the timezone is specified; I can't find a ColdFusion date class that can take a timezone. So, what's the shortest way to convert the format and translate the timezone to GMT (the timezone of my server). So far I have this...
arr3LA = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dev'];
arrDateParts = ListToArray( FORM.payment_date, ' ');
arrTimeParts = ListToArray( arrDateParts[1], ':' );
arrDateParts[3] = Replace(arrDateParts[3], ',', '', 'All');
objPayPalDateTime = CreateDateTime( arrDateParts[4], ArrayFind( arr3LA, arrDateParts[2]), arrDateParts[3], arrTimeParts[1], arrTimeParts[2], arrTimeParts[3] );
strLSFriendly = DateFormat( objPayPalDateTime, 'mmmm dd, yyyy' ) & ' ' & TimeFormat( objPayPalDateTime, 'h:mm:ss tt' ) & ' ' & arrDateParts[5];
objDateTime = LSParseDateTime( strLSFriendly );
strSQLFriendlyDateTime = DateFormat( objDateTime, 'yyyy-mm-dd hh:mm:ss' );
Can you improve on that?