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

x/date_fns/index.js>setHours

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

Examples

// Set 4 hours to 1 September 2014 11:30:00: var result = setHours(new Date(2014, 8, 1, 11, 30), 4) //=> Mon Sep 01 2014 04:30:00

Parameters

dirtyDate
  • the date to be changed
dirtyHours
  • the hours of the new date