TalendDate parseDate not woking

One Star

TalendDate parseDate not woking

Hi,
below,
TalendDate.parseDate("dd-MMM-yyyy", "01-May-2016") ---- its working
TalendDate.parseDate("dd-MMM-yyyy", row1.REVISED_PLAN_DATE) ---Its not woking
but i passes row1.REVISED_PLAN_DAT = "02-May-2011"

Five Stars

Re: TalendDate parseDate not woking

You need to explain what "not working" means.
The most likely outcome is that row1.REVISED_PLAN_DATE does not have the value you expect.
One Star

Re: TalendDate parseDate not woking

In expression builder i want to use the below code.
I declared REVISED_PLAN_DATE as string and assigned the value is "02-May-2011"
TalendDate.formatDate("MM/dd/yyyy",TalendDate.parseDate("dd-MMM-yyyy",row1.REVISED_PLAN_DATE))

but its shows an below error,
Exception in component tMap_1
java.lang.RuntimeException: java.text.ParseException: Unparseable date: ""
Five Stars

Re: TalendDate parseDate not woking

It isn't really clear what you're trying to achieve.
You're converting a String to a Data and then back to a String; but in a different format?
I'd still say that REVISED_PLAN_DATE is not set to the value that you're expecting.
One Star

Re: TalendDate parseDate not woking

Let me explain in detail...
I have an input file (common separated) which has two rows and two columns "Name" & "DOB"
The values in 1st row is   John, 02/May/1950
The values in 2nd row is Alex, 11/Jan/1978
Now, I have to push the input file to another text file (just push as is from the input file except the DOB field needs to be changed to Date column type)

Source (Name as string, DOB as string) and Destination (Name as string, DOB as date)
Have attached the file for your reference. 
Thanks in advance!
One Star

Re: TalendDate parseDate not woking

Hi,
Let me explain in detail...
I have an input file 
The values in 1st row is   John, 02/May/1950
The values in 2nd row is Alex, 11/Jan/1978
And i have one "tFileInputDelimited, tMap and tFileOutputDelimited".

In tMap, i want to change the date format "TalendDate.parseDate("MM-dd-yyyy", row1.DOB) ", but it shows error to convert this line.
Thanks,
Ananth
Five Stars

Re: TalendDate parseDate not woking

it still sounds like you string is not what you think it is. try inserting a tLogRow, so you see the data flowing through.

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

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

Downloads and Trials

Test drive Talend's enterprise products.

Downloads