Export (0) Print
Expand All
Expand Minimize

2.1.911 Part 1 Section 18.17.7.74, DATE

a. The standard does not specify that the year argument must be positive.

Office requires the year argument to be a positive number.

b. The standard defines a normalization process for month and day arguments.

Office applies additional rules to the value of month or day in a year-month-day argument triplet when those values are out of range.

month is simply an instance of counting a given number of months, minus one, relative to January of the year specified, using the Gregorian calendar [ISO-8601]. This calendar defines that there are 12 months in a year, and that when counting forward, the month following December of one year is January of the following year, and when counting backward, the month preceding January of one year is December of the previous year. Likewise, day is simply an instance of counting a given number of days, minus one, relative to the first day of the adjusted month, using the Gregorian calendar. This calendar defines the number of days in each month, and that when counting forward, the day following the final day of one month is the first day of the following month, and when counting backward, the day preceding the first day of one month is the final day of the previous month.

[Example: The year-month-day argument triplets (2007, 12,32), (2007,13,1), and (2008,1,1) all result in the same serial date. end example]

[Note: One way to handle out-of-range values for month or day is as follows:

Compute yearAdjust = INT((month - 1)/12)

Compute adjustedMonth = month - (yearAdjust * 12)

Compute adjustedYear = year + yearAdjust.

A serialDateBase can now be computed for the first day of the adjustedYear and adjustedMonth. Finally, compute the serial date for the full triplet by adding (day-1) to this serialDateBase. end note]

c. The standard indicates various range of values for the year that cause #NUM! to be returned.

Office returns #NUM! if the year is outside the acceptable range for the date base currently in use.

Show:
© 2014 Microsoft