ACR Rules

  1. Home
  2. Docs
  3. ACR Rules
  4. Reliability (41)
  5. Day of year should not be used in parse/format date time functions

Day of year should not be used in parse/format date time functions

Released in version 1.5 (14 February 2020)

This is likely a bug and should be changed.
According to the java documentation for date formating and parsing https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html:

Lowercase “dd” stands for day of month, but uppercase “DD” stands for day of the year.

Although there are valid use-cases for the latter the lowercase version is used much more often.

Noncompliant example:

parseDateTime('2015-05-21', 'yyyy-MM-DD')

Compliant example:

parseDateTime('2015-05-21', 'yyyy-MM-dd')