Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at


Returns the time (in milliseconds) at which the event was created. Starting with Chrome 49, returns a high-resolution monotonic time instead of epoch time.




var number = event.timeStamp;

The following is a more complete example:


<title>timeStamp example</title>

<script type="text/javascript">
function getTime(event) {
  document.getElementById("time").firstChild.nodeValue = event.timeStamp;

<body onkeypress="getTime(event)">

<p>Press any key to get the current timestamp
for the onkeypress event.</p>
<p>timeStamp: <span id="time">-</span></p>



This property only works if the event system supports it for the particular event.


Specification Status Comment
The definition of 'Event.timeStamp' in that specification.
Living Standard  
The definition of 'Event.timeStamp' in that specification.
Working Draft  
Document Object Model (DOM) Level 2 Events Specification
The definition of 'Event.timeStamp' in that specification.
Recommendation Initial definition.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 49.0 ? ? ? ?
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support No support 49.0 ? ? ? ? ? 49.0

Document Tags and Contributors

 Last updated by: jpmedley,