How to convert date format?

0

Hi,

I'm trying to read data from an excel file and I have a "date" column which has the "MM/DD/YYYY" format.

I need to put this data into MySQL, where the supported format is "YYYY-MM-DD"

How can I convert it? If I create a variable in tMap component, I've seen there is a "parseDate" function within "TalendDate" functions category. I think that's what need to use, but I cannot really understand how.

Please advise.

Thanks

rdoe's picture
6
Joined: Jul 12 2009 - 2:53pm
Last seen: 10 years 1 week ago

1 Answer:

0

With the TalendDate.parseDate() function you should be able to convert your date.

In your case it'll look something like:

TalendDate.parseDate("MM/dd/yyyy",row1.Date)

Then in the output table you just enter "yyyy-MM-dd" format in the "Date Pattern" field.

Cheers,

Stas

stasp's picture
12484
Joined: Jun 3 2009 - 9:53am
Last seen: 10 hours 41 min ago
Feedback