How to perform validation on date field

Four Stars

How to perform validation on date field

Hello there! 

I have a Date field/Column in input and I want to apply validation operation like (Is_valid) to check whether the input date is in particular format (lets say dd-mm-yyyy) or not, if not I want to reject that record.

Please let me know/suggest me how can I perform this is_valid on date field

 

Thanks in advance

Forteen Stars TRF
Forteen Stars

Re: How to perform validation on date field

Have a look to TalendDate.parseDate() method


TRF
Four Stars

Re: How to perform validation on date field

Actually am a beginner in talend and I tried the various date function's like TalendDate.formatDate, TalendDate.parseDate, TalendDate.isDate. 

but didn't get solution.

 

Could you please help me with an example or solution for below case.

My input filed 't_date' is in format 'dd-MM-yyyy', here I want to reject the records if it is not in the specified format else it should be proceed further.

 

By the way thanks for your reply!

Forteen Stars TRF
Forteen Stars

Re: How to perform validation on date field

Did you try:
TalendDate.isDate(row1.t_date, "dd-MM-yyyy")
This suppose t_date is a String.

TRF