Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to convert string to date format

I am creating a job where below is the job flow
tRestClient->tExtractXMLField ->tXMLMap ->tMongoOutput
I am having an input date as shown below and please tell me how can i output in the ISODATE format

input date format -> 2006-10-05 14:34:58
expected output date format -> ISODate("2016-07-14T00:00:00.000+0000")
Labels (4)
3 Replies
Anonymous
Not applicable
Author

Hello 

I don't understand why you use tXMLMap component in your job, I think you just a tMap to do some transformation. Try to parse the string to a Date with this expression on tMap:
TalendDate.parseDate("yyyy-MM-dd HH:mm[font=consolas, monaco, bitstream vera sans mono, courier new, courier, monospace] :ss[/font]", row1.columnName)

In the output table, select 'Date' type for this column and set its date pattern as "yyyy-MM-dd' T'HH:mm[font=consolas, monaco, bitstream vera sans mono, courier new, courier, monospace] :ss[/font] Z"

Let me know if it works. 

Regards
Shong
Anonymous
Not applicable
Author

Thanks Shong. I am able to parse the data. 


-Supriya 
Anonymous
Not applicable
Author

Great, thanks for your feedback 0683p000009MA9p.png