DateNumber function (LotusScript® Language)

Returns a date value for a given set of year, month, and day numbers.

Syntax

DateNumber ( year , month , day )

DateSerial is acceptable in place of DateNumber.

Elements

year

A numeric expression designating a year.

If you specify a 2-digit year designation (yy) in Notes® or Domino®, LotusScript® interprets 50 through 99 as the years 1950 through 1999 and 00 through 49 as the years 2000 through 2049. For example, 88 and 1988 are equivalent year designations and 12 and 2012 are equivalent year designations.

If you specify a 2-digit year designation in SmartSuite®, LotusScript® interprets the years differently. For information on how each SmartSuite® product interprets 2-digit year designations, see the online Help entry entitled Year 2000. This entry appears on the Help menu of each SmartSuite® product.

month

A numeric expression designating a month of the year (a value from 1 through 12).

If you assign month a negative value, DateNumber calculates a prior date by measuring backward from December of the preceding year. (For example, 1995, -2, 10 is evaluated as October 10, 1994.)

day

A numeric expression designating a day of the month (a value from 1 through 31).

If you assign day a negative value, then DateNumber calculates a prior date by measuring backward from the last day of the month immediately preceding the specified month. (For example, 1995, 5, -3 is evaluated as April 27, 1995, by subtracting 3 from 30, the last day of April, the month before the 5th month.)

Return value

DateNumber returns the date value for the given year, month, and day.

The data type of the return value is a Variant of DateType 7 (Date/Time).

Example