Skip to main content
Solved

toDate function in Ataccama


Hi All,

toDate(Input, “yyyy/MM/dd”) function is not throwing null when I am passing value “1/1/1”. Input datatype is string.

can anybody help why it takes 1/1/1 as valid date value?

Regards,
Shefhali

Best answer by AKislyakov

Hi ​@Shefhali singh,

“1/1/1” under this format is read as “1st January 0001 AD”, which is a valid date, Monday.
You might want to add an additional rules, to validate that the resulting date falls within certain range, e.g. no older than a hundred years from now.

View original

Also, Is there any function or method available to validate a date which datatype is string?


Forum|alt.badge.img+2

Hi ​@Shefhali singh,

“1/1/1” under this format is read as “1st January 0001 AD”, which is a valid date, Monday.
You might want to add an additional rules, to validate that the resulting date falls within certain range, e.g. no older than a hundred years from now.


Thank you team, i have added some other regexp to handle these special cases that I want to fail


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings