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

x/date_fns/index.js>setDate

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

Examples

// Set the 30th day of the month to 1 September 2014: var result = setDate(new Date(2014, 8, 1), 30) //=> Tue Sep 30 2014 00:00:00

Parameters

dirtyDate
  • the date to be changed
dirtyDayOfMonth
  • the day of the month of the new date