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

x/date_fns/index.js>setDayOfYear

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

Examples

// Set the 2nd day of the year to 2 July 2014: var result = setDayOfYear(new Date(2014, 6, 2), 2) //=> Thu Jan 02 2014 00:00:00

Parameters

dirtyDate
  • the date to be changed
dirtyDayOfYear
  • the day of the year of the new date