Skip to main content
Deno 2 is finally here 🎉️
Learn more
Very Popular
Latest
function default
import { default } from "https://deno.land/x/date_fns@v2.22.1/subSeconds/index.ts";

Examples

// Subtract 30 seconds from 10 July 2014 12:45:00: const result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) //=> Thu Jul 10 2014 12:44:30

Parameters

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

Returns

the new date with the seconds subtracted