Year

Use this function to determine the number of the year in a given date and returns the value as a four-digit number.

Syntax

Year (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 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

Year ( )

2009

Defaults to the current date and returns a four-digit year.

Year ("2-5-09", "1-2")

2009

Returns a four-digit year for the given date.

See also