Date error

Six Stars

Date error

Hi everybody!

 

I'm having problems with inserting data in the date field.

I receive the data of an Excel and I have a column that has some dates, when I do in the TMap the parseDate I get the following error:
Unparseable date: "25/09/2014"

I have this data entry: "25/09/2014"

 

And in database, it is saved like this:
2015-12-01T17: 35: 17.55Z

 

I have tried with the solutions that I have found in this forum, but I have not had any luck. Can you help me?

Thank you!

Attached pictures of tMap!tmap1.PNGtmap2.PNG

 

regards!


Accepted Solutions
Forteen Stars

Re: Date error

@LLBetween , now in tmap output section of the field date format specify the below one.

"yyyy-MM-dd'T'HH:mm:ss Z"

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Six Stars

Re: Date error

Thanks for you reply!

 

I solved the problem with this code: "yyyy-MM-dd'T'HH:mm:ss'Z'" if i don't put 'Z' i can't insert into SQL Server.

 

I hope this can help someone with the same problem.

 

Regards!


All Replies
Forteen Stars

Re: Date error

@LLBetween ,try with below format.it should work.

 

TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ssZ",row1.col)

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Six Stars

Re: Date error

Thanks for your quick response.

The error keeps appearing: java.lang.RuntimeException: java.text.ParseException: Unparseable date: "25/09/2014"

I have to change a component or something in the Data Patter of tMap?

Thanks!
Forteen Stars

Re: Date error

@LLBetween ,try with below one.

 

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

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Six Stars

Re: Date error

Thanks for your reply!

 

Now I do not see the error, but it does not insert the data in the database.

In Database the field I need to be inserted like this: 2017-05-19T15:35:29.667Z

 

This message appears: | The field [salesForecastDate] is other type (3)

Forteen Stars

Re: Date error

@LLBetween , now in tmap output section of the field date format specify the below one.

"yyyy-MM-dd'T'HH:mm:ss Z"

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Six Stars

Re: Date error

Thanks for you reply!

 

I solved the problem with this code: "yyyy-MM-dd'T'HH:mm:ss'Z'" if i don't put 'Z' i can't insert into SQL Server.

 

I hope this can help someone with the same problem.

 

Regards!

Forteen Stars

Re: Date error

@LLBetween , I gave the solution,which you should mark as a solution.

 

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Six Stars

Re: Date error

Do it!

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog