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

Fifteen Stars TRF
Fifteen 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!

Highlighted
Fifteen Stars TRF
Fifteen 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

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

APIs for Dummies

View this on-demand webinar about APIs....

Watch Now