Date formatting error

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

 


Accepted Solutions
Fifteen Stars TRF
Fifteen 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

All Replies
Fifteen Stars TRF
Fifteen 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

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.