Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

std/datetime/week_of_year.ts>weekOfYear

The Deno Standard Library
Go to Latest
function weekOfYear
import { weekOfYear } from "https://deno.land/std@0.222.1/datetime/week_of_year.ts";

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

Examples

Example 1

import { weekOfYear } from "https://deno.land/std@0.222.1/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.