Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
isDate("4/10/2018", "MM/dd/yyyy") returns false
I'm trying to filter on a string field that is supposed to be a date, so I want to check first with TalendDate.isDate in a filter.
jji
I guess the real question is why does:
String foo = "4/13/2001"; String format = "MM/dd/yyyy"; System.out.println( TalendDate.isDate( foo, format ) ); System.out.println( TalendDate.compareDate( new Date(), TalendDate.parseDate( format, foo ) ) );
return:
false 1
You can use
TalendDate.isDate("4/1/2018", "M/d/yyyy") returns True
TalendDate.isDate("12/21/2018", "M/d/yyyy") returns True
TalendDate.isDate("15/21/2018", "M/d/yyyy") returns false
You can use
TalendDate.isDate("4/1/2018", "M/d/yyyy") returns True
TalendDate.isDate("12/21/2018", "M/d/yyyy") returns True
TalendDate.isDate("15/21/2018", "M/d/yyyy") returns false