Jump to content
JasperReports 7.0 is now available ×

How to convert date format?


rdoe

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...