Date formatting error

Highlighted
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

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 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

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

Download