Skip to main content
Module

std/datetime/mod.ts>weekOfYear

The Deno Standard Library
Latest
function weekOfYear
import { weekOfYear } from "https://deno.land/std@0.223.0/datetime/mod.ts";

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

Examples

Basic usage

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

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

weekOfYear(new Date("2020-07-10T03:24:00")); // 28

Parameters

date: Date

Date to get the week number of.

Returns

number

The week number of the provided date.