---
title: date.year() function
description: >
  The `date.year()` function returns the year of a specified time.
aliases:
  - /v2.0/reference/flux/functions/date/year/
menu:
  v2_0_ref:
    name: date.year
    parent: Date
weight: 301
---

The `date.year()` function returns the year of a specified time.

_**Function type:** Transformation_  

```js
import "date"

date.year(t: 2019-07-17T12:05:21.012Z)

// Returns 2019
```

## Parameters

### t
The time to operate on.

_**Data type:** Time_
