setTime (JavaScript)

Sets the time as a numeric value.

Defined in

Date (Standard - JavaScript)

Syntax

setTime(time:long) : long
Parameters Description
time The milliseconds from 0 hours, January 1, 1970 UTC.
Return value Description
long The new time in numeric format.

Examples

This computed label sets the current time plus 1 hour.
var date = new Date();
date.setTime(date.getTime() + 3600000); // plus 1 hour
date.toString()