dayOfYear

import { dayOfYear } from "jsr:@ende/datetime";

function

function dayOfYear(date: Date): number

Returns the number of the day in the year in the local time zone.

date: Date

Date to get the day of the year of.

Returns

Number of the day in the year in the local time zone.

Example: Basic usage

import { dayOfYear } from "@ende/datetime/day-of-year";
import { assertEquals } from "@ende/assert";

assertEquals(dayOfYear(new Date("2019-03-11T03:24:00")), 70);

Source