Skip to main content
Deno 2 is finally here 🎉️
Learn more
Very Popular
Latest
function default
import { default } from "https://deno.land/x/date_fns@v2.22.1/setMonth/index.ts";

Examples

// Set February to 1 September 2014: const result = setMonth(new Date(2014, 8, 1), 1) //=> Sat Feb 01 2014 00:00:00

Parameters

dirtyDate: Date | number
  • the date to be changed
dirtyMonth: number
  • the month of the new date

Returns

the new date with the month set