Function: getDayOfYear

getDayOfYear(time): number

获取某个日期是当年中的第几天

Parameters

Name Type Description
time string | Date 日期字符串或Date对象

Returns

number

当年中的第几天

Since

1.2.4

Example

getDayOfYear('2014-01-10')
// => 10

getDayOfYear(new Date(2014, 0, 10))
// => 10
ON THIS PAGE