Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/datetime/mod.ts>weekOfYear

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function weekOfYear
import { weekOfYear } from "https://deno.land/std@0.190.0/datetime/mod.ts";

Returns the ISO week number of the provided date (1-53).

Examples

Example 1

import { weekOfYear } from "https://deno.land/std@0.190.0/datetime/week_of_year.ts";

weekOfYear(new Date("2020-12-28T03:24:00")); // Returns 53

Returns

number

Number of the week in year