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
- SVGZoomEventSVGZoomEvent
- BeforeUnloadEventBeforeUnloadEvent
- CompositionEventCompositionEvent
- CustomEventCustomEvent
- DragEventDragEvent
- EventEvent
- FocusEventFocusEvent
- KeyboardEventKeyboardEvent
- MessageEventMessageEvent
- MouseEventMouseEvent
- MutationEventMutationEvent
- StorageEventStorageEvent
- TextEventTextEvent
- UIEventUIEvent
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]