This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

timeStamp

Summary

Gets the time, in milliseconds, when an event occurred.

Property of dom/Eventdom/Event

Syntax

Note: This property is read-only.

var eventTimestamp = event.timeStamp;

Return Value

Returns an object of type NumberNumber

The event time stamp, in milliseconds since 1970-1-1 00:00:00 UTC.

Examples

The following event handler displays the event time by using the current locale settings.

function eventHandler(evt) {
    var dt = new Date(evt.timeStamp);
    alert(dt.toLocaleString());
}
window.onload = eventHandler;

Related specifications

DOM Level 3 Events
Working Draft

See also

Related pages

Attributions