Skip to main content
Home
This release is 12 versions behind 0.225.6 — the latest version of @std/datetime. Jump to latest

@std/datetime@0.224.0
Built and signed on GitHub Actions

Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score100%
Downloads3,733/wk
Published2 years ago (0.224.0)

UNSTABLE: Utilities for dealing with Date objects

function dayOfYear
dayOfYear(date: Date): number

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

Examples

Basic usage

import { dayOfYear } from "@std/datetime/day-of-year";

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

Parameters

date: Date

Date to get the day of the year of.

Return Type

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

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/datetime

Import symbol

import { dayOfYear } from "@std/datetime";
or

Import directly with a jsr specifier

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

Add Package

pnpm i jsr:@std/datetime
or (using pnpm 10.8 or older)
pnpm dlx jsr add @std/datetime

Import symbol

import { dayOfYear } from "@std/datetime";

Add Package

yarn add jsr:@std/datetime
or (using Yarn 4.8 or older)
yarn dlx jsr add @std/datetime

Import symbol

import { dayOfYear } from "@std/datetime";

Add Package

vlt install jsr:@std/datetime

Import symbol

import { dayOfYear } from "@std/datetime";

Add Package

npx jsr add @std/datetime

Import symbol

import { dayOfYear } from "@std/datetime";

Add Package

bunx jsr add @std/datetime

Import symbol

import { dayOfYear } from "@std/datetime";