You are not logged in.

Unanswered posts



Important! This site has been replaced. All content here is read-only. Please visit our brand-new community at https://community.talend.com/. We look forward to hearing from you there!



#1 2017-03-25 22:33:51

SupriyaPasham
Member
4 posts

SupriyaPasham said:

How to convert string to date format

Tags: [, database, date]

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")

Offline

#2 2017-03-26 05:13:43

shong
Talend Team


shong said:

Re: How to convert string to date format

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:ss", row1.columnName)

In the output table, select 'Date' type for this column and set its date pattern as "yyyy-MM-dd'T'HH:mm:ssZ"

Let me know if it works. 

Regards
Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the global leader of open source data management and application integration solutions!

Offline

#3 2017-03-26 18:14:07

SupriyaPasham
Member
4 posts

SupriyaPasham said:

Re: How to convert string to date format

Thanks Shong. I am able to parse the data. 


-Supriya 

Last edited by SupriyaPasham (2017-03-26 18:34:09)

Offline

#4 2017-03-27 09:47:32

shong
Talend Team


shong said:

Re: How to convert string to date format

Great, thanks for your feedback;)


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the global leader of open source data management and application integration solutions!

Offline

Board footer

Talend Contributor Agreement - Talend Website Privacy Policy