Four Stars

Date formatting error

Hello All,

    I have  my CSV date data which is of form yyyyMMdd form and i want to result as yyyy-MM-dd hh:mm:ss so i used function TalendDate.formatDate("yyyyMMdd"row1.FKDAT)  but i am getting error string literal not properly closed by double quotes.I also used function TalendDate.parseDate("yyyyMMdd"row1.FKDAT) still getting same errorTalenddate.jpg

 

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Seven Stars TRF
Seven Stars

Re: Date formatting error

As you have date fields for both input and output, TalendDate.formatDate is not applicable.

TalendDate.formatDate is to convert from string to date datatype.

Simply try to adapt the date format:

Capture.PNG

The result will be like this:

Starting job test at 23:08 22/05/2017.

[statistics] connecting to socket on port 3472
[statistics] connected
20170522
2017-05-22 12:00:00
[statistics] disconnected
Job test ended at 23:08 22/05/2017. [exit code=0]

 


TRF
1 REPLY
Seven Stars TRF
Seven Stars

Re: Date formatting error

As you have date fields for both input and output, TalendDate.formatDate is not applicable.

TalendDate.formatDate is to convert from string to date datatype.

Simply try to adapt the date format:

Capture.PNG

The result will be like this:

Starting job test at 23:08 22/05/2017.

[statistics] connecting to socket on port 3472
[statistics] connected
20170522
2017-05-22 12:00:00
[statistics] disconnected
Job test ended at 23:08 22/05/2017. [exit code=0]

 


TRF