Get the day of the year of the given date.
Get the day of the year of the given date.
// CommonJS
var getDayOfYear = require('date-fns/getDayOfYear')
// ES 2015 import getDayOfYear from 'date-fns/getDayOfYear'
// ESM
import { getDayOfYear } from 'date-fns'
getDayOfYear(date)
| Name | Description |
|---|---|
date |
the given date |
| Description |
|---|
|
the day of year |
| Type | Description |
|---|---|
TypeError |
1 argument required |
// Which day of the year is 2 July 2014? const result = getDayOfYear(new Date(2014, 6, 2)) //=> 183
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/getDayOfYear