Skip to main content
Solved

toDate function in Ataccama

  • June 20, 2025
  • 3 replies
  • 59 views

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.

3 replies

  • Author
  • Space Explorer
  • June 20, 2025

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


Forum|alt.badge.img+2
  • Ataccamer
  • Answer
  • June 20, 2025

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.


  • Author
  • Space Explorer
  • June 27, 2025

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