Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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 -
result
tmap
row generator and date as string value
---> TalendDate.parseDate("yyyy-MM-dd",row1.Date) <------
Pls get back to Community, if necessary.
Thanks,
Ankit.
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
that worked - thanks. I was going round in circles...
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 -
result
tmap
row generator and date as string value
---> TalendDate.parseDate("yyyy-MM-dd",row1.Date) <------
Pls get back to Community, if necessary.
Thanks,
Ankit.
Should have replied earlier. This worked perfectly - thanks for the help.