Search w3schools.com:

SHARE THIS PAGE

timeStamp Event Property

Event Object Reference Event Object

Definition and Usage

The timeStamp event property returns the number of in milliseconds since midnight of January 1, 1970.

It can be used as a time stamp of when the event was triggered.

Not all systems provide this information, therefore, timeStamp may be not available for all systems/events.

Syntax

event.timeStamp
 

Example

Example

The following example gets the timestamp from the system start:

<html>
<head>
<script>
function myFunction(e)
  {
  alert(e.timeStamp);
  }
</script>
</head>

<body>

<p onclick="myFunction(event)">Click this paragraph. An alert
box will alert the timestamp.</p>

</body>
</html>

Try it yourself »


Event Object Reference Event Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]