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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date Parsing...

Hi 

I'm having real trouble converting an input string of

 

2010-01-26T00:00:00

 

to a date string YYYY-MM-DD

 

The issue in my dateParse is the T - can't work out the for life of me how to set the input format in the parsing to convert to what I need.

 

Any help would be great.

 

Thanks

Dave

Labels (2)
1 Solution

Accepted Solutions
ankit7359
Creator II
Creator II

Hi @DaveG2008 ,

you can convert string to date by using talenddate.parsedate method and if you want the vice - versa (Date to string) - then use talenddate.formatdate method.

Pls check the below screen shots -

0683p000009M28L.pngresult0683p000009M28R.pngtmap0683p000009M2ai.pngrow generator and date as string value

---> TalendDate.parseDate("yyyy-MM-dd",row1.Date) <------

Pls get back to Community, if necessary.

Thanks,

Ankit.

View solution in original post

4 Replies
ThWabi
Creator II
Creator II

Hi Dave,

 

I think this should work:

your_date = TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss", your_input_string)
your_output_string = TalendDate.formatDate("yyyy-MM-dd", your_date) 

 

Best regards,

 

Thomas

Anonymous
Not applicable
Author

that worked - thanks.  I was going round in circles...

ankit7359
Creator II
Creator II

Hi @DaveG2008 ,

you can convert string to date by using talenddate.parsedate method and if you want the vice - versa (Date to string) - then use talenddate.formatdate method.

Pls check the below screen shots -

0683p000009M28L.pngresult0683p000009M28R.pngtmap0683p000009M2ai.pngrow generator and date as string value

---> TalendDate.parseDate("yyyy-MM-dd",row1.Date) <------

Pls get back to Community, if necessary.

Thanks,

Ankit.

Anonymous
Not applicable
Author

Should have replied earlier.  This worked perfectly - thanks for the help.