Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
EnriqueLDE
Contributor II

Convert string to date

Hi,

 

I have my string input 01012021 and i need to convert it to date output 01/01/2021 in my tmap. How can i do that? Thank you!

 

Regards,

Enrique

Labels (2)
1 Solution

Accepted Solutions
gjeremy1617088143

Hi,

TalendDate.parseDate("ddMMyyyy",here your input string)

Send me Love and Kudos

View solution in original post

6 Replies
gjeremy1617088143

Hi,

TalendDate.parseDate("ddMMyyyy",here your input string)

Send me Love and Kudos

EnriqueLDE
Contributor II
Author

Thank you!

gjeremy1617088143

you'r welcome , in your output schema set a pattern for your date : "dd/MM/yyyy", if you want the date as you mention.

 

EnriqueLDE
Contributor II
Author

I get an error because there is a null value in my input. How do you set a condition to ignore the value when it's null or do TalendDate.parseDate("ddMMyyyy",input) when it is not null? Thank you!

gjeremy1617088143

You can write (your input) != null

in the expression filter of the tMap output

CSharma1636705679
Contributor

Hey Thanks a lot, but I am having one issue I got "ERROR: timestamp out of range". my string is a timestamp I want to make it as a timestamp (Date)

my timestamp is - "1631898440"

please help 😞