Date.setMilliseconds

setMilliseconds – Set the milliseconds, according to local time (0–999).

Description

Date.setMilliseconds(integer milliseconds)

Parameters

Name Description Type Default Optional
milliseconds integer No

Return values

Integer. The new timestamp.

Examples

Example #1 – setMilliseconds example
var date = new Date(2015, 9, 21, 16, 29, 00); console.log(date.getTime()); // 1445437740000 (CEST) // 1445459340000 (EDT) console.log(date.setMilliseconds(10)); // 1445437740010 (CEST) // 1445459340010 (EDT)

External references