Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a csv source file where the date coming in is a string format: 4/26/2013 11:07:05 PM
I need to convert this to a date format or 2013-04-26
I can't seem to get the basic functions to work. Do I need to parse out the 'PM' first?
This should work
SimpleDateFormat sdf = new SimpleDateFormat("M/dd/yyyy hh:mm:ss a");
Date d = sdf.parse("4/26/2013 11:07:05 PM"); sdf.applyPattern("yyyy-MM-dd"); String newDateString = sdf.format(d); //2013-04-26
I was originally trying to do this in a tMap expression. Would I use tJava to execute the script provided?