timeStamp property
Gets the time, in milliseconds, when an event occurred.
![]() ![]() |
Syntax
| JavaScript | |
|---|
Property values
Type: Integer
The time of the event, in milliseconds, since midnight, January 1, 1970, Coordinated Universal Time (UTC).
Standards information
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;
See also
- BeforeUnloadEvent
- CompositionEvent
- CustomEvent
- DragEvent
- Event
- FocusEvent
- KeyboardEvent
- MessageEvent
- MouseEvent
- MouseWheelEvent
- MSGestureEvent
- MSSiteModeEvent
- MutationEvent
- PointerEvent
- StorageEvent
- SVGZoomEvent
- TextEvent
- UIEvent
Show:

