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

x/date_fns/index.js>setMonth

date-fns Deno package
Very Popular
Go to Latest
function setMonth
import { setMonth } from "https://deno.land/x/date_fns@v2.5.1/index.js";

Examples

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

Parameters

dirtyDate
  • the date to be changed
dirtyMonth
  • the month of the new date