This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help

Next Topic

Book Contents

Book Index

Date formats

Snap will support a wide range of date formats and it is perhaps best to describe the rules for each of the components of a date, namely the day, the month and the year.

Day

The day number must appear in the range 1 to 31, with optional leading zeros. For example, 01, 02, etc. are acceptable. The validity of a day number will be checked in conjunction with the month. For example, 31 September will be invalid. In the case of February, the year will also be checked for the occurrence of a leap year.

The day number can appear before or after the month, e.g. 1 Jan or Jan 1.

Day suffixes such st, nd, rd, th are not necessary and are not accepted, unless a suitable date pattern has been applied to the variable.

Local rules for date, such as the US standard of Month/Day/Year, will be recognised. Consequently, 01/05/97 will be calculated as January 5th 1997 in the US and May 1st 1997 in the UK (the computer date settings control these formats).

The day number must be separated from the month by either a full stop (.), a hyphen (-) or a slash (/) or, if the month is expressed as a word, by a space.

In the special case where the month name is given before the day number, a comma can be used to separate the day and year, e.g. January 5,1997

Month

The month can appear in full, e.g. January, or abbreviated to the first 3 characters, e.g. Jan, or as a number, e.g. 01.

The only exceptions to the 3 character abbreviation rule are July which can be Jul or Jly, and September which can be Sep or Sept.

The month must be separated from the day and the year by either a full stop (.), a hyphen (-) or a slash (/) or, if the month is expressed as a word, by a space.

Year

The year number can either be the last 2 digits, e.g. 97, or the full year, e.g. 1997. If the two digit number is used, it is assumed that the year is between 1930 and 2029 inclusive. Then 97 will represent 1997, 00 will represent 2000, and 29 will represent 2029. To represent any year before 1930 or any date after 2029, you should include all digits, e.g. 1929.

The year must be separated from the month by either a space, a full stop (.), a hyphen (-) or a slash (/).

Two further points relate to dates:

See Also

Date Functions

Categorising date responses

Using a date function to determine the day of the week of a date

Calculating age from a date of birth