YearDay

Use this function to determine the number of days from the beginning of the year (counting consecutively from January 1) to a given date and return the value as a number.

Syntax

YearDay (Date, Format, Locale)

Parameter

Description

Date

Enter a valid date string. The system assumes your entry is in the date format specified by the Format parameter. The default is the current date.

Format

Enter a valid date format that describes your entry in the Date parameter. The default is date format 1, (MM/DD/YY).

Locale

(Optional) Enter the locale code. If you omit this parameter, the system checks the Locale INI option. If the Locale INI option offers no value, the system defaults to USD (United States/English).

The system determines the day of the year portion of the given date based on the format you specified in the Format parameter.

Example

Here are some examples:

(Assume the current date is 07/01/09.)

Function

Result

Explanation

YearDay ( )

182

Defaults to the current date and returns the day of the year (counting consecutively from January 1).

YearDay ("7-1-08")

183

Returns the day of the year (counting consecutively from January 1) for the given date. (Since 2008 is a leap year the number is one greater.)

See also