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/setSeconds/index.ts";

Examples

// Set 45 seconds to 1 September 2014 11:30:40: const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45) //=> Mon Sep 01 2014 11:30:45

Parameters

dirtyDate: Date | number
  • the date to be changed
dirtySeconds: number
  • the seconds of the new date

Returns

the new date with the seconds set