Quantcast
Channel: Adobe Community : Popular Discussions - LiveCycle Workbench
Viewing all articles
Browse latest Browse all 69588

Convert date string to date/time object

$
0
0

I have a JDBC call to grab some data including a date/time stamp.  For the life of me, I can't figure out how to convert that string to a proper date/time field.  It's important because I need to use validation strings to present a more simplified date/time to users on a form.  But I'd like to keep the original date/time so I can reinsert it into a SQL db at the end.  I created a test process so I can watch the progress.


input string = '2010/08/18 16:41:23'

Expression = parse-dateTime-withFormat (/process_data/@datestring,"yyyy/MM/dd hh:mm:ss","en","US","WIN","CDT")

Result = August 18, 2010 9:41:23 PM GMT

Then I try to put that value into a date field and I get the error:
: Invalid ISO8601 DateTime:August 18, 2010 9:41:23 PM GMT:java.text.ParseException: Unparseable date: "August 18, 2010 9:41:23 PM GMT"


I've tried like 100 different variations to map into a date/time object with the same result.  I can use the parse-dateTime or parse-dateTime-withFormat functions all day long but I can't get that string value into a proper date field.  Any ideas?  Please help as I'm about to pull my hair out ...and that won't be pretty.

 

(Note:  I realize my time zone didn't come thru correct but I'm not concerned about that right now)

 


Viewing all articles
Browse latest Browse all 69588

Trending Articles