Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
function default
import { default } from "https://deno.land/x/date_fns@v2.7.0/subHours/index.js";

Examples

// Subtract 2 hours from 11 July 2014 01:00:00: var result = subHours(new Date(2014, 6, 11, 1, 0), 2) //=> Thu Jul 10 2014 23:00:00

Parameters

dirtyDate
  • the date to be changed
dirtyAmount
  • the amount of hours to be subtracted