Date String Formatting

A correctly formatted date string consists of three integers separated by a forward slash character (/) or a full stop (.), all enclosed within double quotes. For example:

"25/07/2013"

The integers cannot exceed the maximum value of the real date component it represents, which means the first number (day) cannot be higher than the number of days in the second (month) number, which itself cannot be higher than the number of months in a year.

Single-digit month and day values can be either the number on its own, or with a prefixed 0. In the Expression Engine, both of the following dates are correct and equal.

"7/7/2011"

"07/07/2011"

The third number (year) can be any number between 0 and 9999:

  • Any number between 0 and 29 represents the years 2000 to 2029, respectively.
  • Numbers from 30 to 99 represent the years 1930 to 1999, respectively.
  • Any number between 100 and 9999 represent the actual year itself.

 

<< Previous: Date Functions | Next: GetDate >>