Module

std/datetime/mod.ts>weekOfYear

Deno standard library
Go to Latest
function weekOfYear
import { weekOfYear } from "https://dotland.deno.dev/std@0.181.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.181.0/datetime/week_of_year.ts";

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

Parameters

date: Date

Returns

number

Number of the week in year