Skip to main content
Deno 2 is finally here 🎉️
Learn more
Very Popular
Go to Latest
function setMilliseconds
import { setMilliseconds } from "https://deno.land/x/date_fns@v2.0.0-alpha.35/index.js";

Examples

// Set 300 milliseconds to 1 September 2014 11:30:40.500: var result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300) //=> Mon Sep 01 2014 11:30:40.300

Parameters

dirtyDate
  • the date to be changed
dirtyMilliseconds
  • the milliseconds of the new date