@stdlib/time
Version:
Time utilities.
48 lines (35 loc) • 1.03 kB
Plain Text
{{alias}}( [month[, day, year]] )
Returns the day of the year.
By default, the function returns the day of the year for the current date
(according to local time). To determine the day of the year for a particular
day, provide `month`, `day`, and `year` arguments.
A `month` may be either a month's integer value, three letter abbreviation,
or full name (case insensitive).
The function also accepts a `Date` object.
Parameters
----------
month: string|integer|Date (optional)
Month (or `Date`).
day: integer (optional)
Day.
year: integer (optional)
Year.
Returns
-------
out: integer
Day of the year.
Examples
--------
> var day = {{alias}}()
<number>
> day = {{alias}}( new Date() )
<number>
> day = {{alias}}( 12, 31, 2016 )
366
// Other ways to supply month:
> day = {{alias}}( 'dec', 31, 2016 )
366
> day = {{alias}}( 'december', 31, 2016 )
366
See Also
--------