Built in service or any other way to identify invalid date

Hello All,

I have a requirement.
Do we have any built in service that can be used to identify if the input date is invalid or not.
Example: 2929-07-28 should be returned as invalid.

Urgent help needed!

Regards,
Khushaboo Shandilya

Hi Khushaboo,

We can check for the date formats using built in service dateTimeFormat and that will fail if there is invalid date.

But there is no straight built in service to confirm if the date is valid or not as far as I know.

Regards,
Firoz N

1 Like

Hi Khushaboo,

your example is a valid date (even when 909 years in the future) as per the accordning ISO documentation for dates.
If you want to exclude dates that far in the future, you will have to validate it by your self.

There is an interesting discussion about calculating date differences in this topic:

Regards,
Holger

Hi,

Just wondering: Are you trying to develop/implementing this logic in wm.io/cloud tenant or on-prem IS instance setup thru?

Anyways there is none OOTB service available to check and scan if it’s a future date (reject) vs current date (valid case) and so may need to go with custom java code validation techniques etc…

HTH,
RMG