# Year
{: .no_toc }

Returns a **Variant** (**Integer**) containing a whole number representing the year.

Syntax: **Year** ( *date* )

*date*
: *required* Any **Variant**, numeric expression, string expression, or any combination that can represent a date. If *date* contains **Null**, **Null** is returned.

> [!NOTE]
> If the [**Calendar**](/tB/Modules/DateTime/Calendar.md) property setting is Gregorian, the returned integer represents the Gregorian year for the date argument. If the calendar is Hijri, the returned integer represents the Hijri year for the date argument.

### Common Errors

| Error | When |
|---|---|
| [13 (`&HD`)](/Reference/Run-time-Errors.md#13), *Type mismatch* | *date* is a string that is not a date, a number outside the range of dates, or an **Error** value |

### Example

This example uses the **Year** function to obtain the year from a specified date.

```tb check_build
Dim MyDate, MyYear
MyDate = #February 12, 1969#    ' Assign a date.
MyYear = Year(MyDate)    ' MyYear contains 1969.
```

### See Also

- [Day](/tB/Modules/DateTime/Day.md), [Month](/tB/Modules/DateTime/Month.md), [DatePart](/tB/Modules/DateTime/DatePart.md) functions
