Skip to main content
Very Popular
Latest
function default
import { default } from "https://deno.land/x/date_fns@v2.22.1/subHours/index.ts";

Examples

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

Parameters

dirtyDate: Date | number
  • the date to be changed
dirtyAmount: number
  • the amount of hours to be subtracted. Positive decimals will be rounded using Math.floor, decimals less than zero will be rounded using Math.ceil.