docs-v2/content/v2.0/reference/flux/stdlib/date/year.md

496 B

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

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

Function type: Transformation

import "date"

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

// Returns 2019

Parameters

t

The time to operate on.

Data type: Time