DATE (return standard date)

Top  Previous  Next

 

DATE(month,day,year)

DATE

Return standard date.

month

A numeric constant, variable, or expression for the month.

day

A numeric constant, variable, or expression for the day of the month.

year

A numeric constant, variable or expression for the year. The valid range for a year value is 00 through 99 (using "Intellidate" logic), or within the Clarion standard date range.

The DATE procedure returns a standard date for a given month, day, and year. The month and day parameters do allow positive out-of-range values. A month value of 13 is interpreted as January of the next year. A day value of 32 in January is interpreted as the first of February. Consequently, DATE(12,32,97), DATE(13,1,97), and DATE(1,1,98) all produce the same result.

The century for a two-digit year parameter is resolved using the default "Intellidate" logic, which assumes the date falls in the range of the next 20 or previous 80 years from the current operating system date. For example, assuming the current year is 1998, if the year parameter is "15," the date returned is in the year 2015, and if the year parameter is "60," the date returned is in 1960.

Return Data Type:

LONG

Example:

HireDate = DATE(Hir:Month,Hir:Day,Hir:Year)          !Compute hire date

FirstOfMonth = DATE(MONTH(TODAY()),1,YEAR(TODAY()))  !Compute First day of month

DaysInMonth = DAY(DATE(mn + 1,0,yr))          !Compute days in a month

 

See Also:

Standard Date

DAY

MONTH

YEAR

TODAY