W3Schools.com

timeStamp Event Attribute

Event Object Reference Event Object

Definition and Usage

The timeStamp event attribute returns the time stamp, in milliseconds, from the epoch.

The epoch is a time reference point. In this case it is when the clients computer started up.

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 type="text/javascript">
function showTimestamp(event)
  {
  var minutes = 1000*60
  var x=event.timeStamp;
  alert(x/minutes)
  }
</script>
</head>

<body onmousedown="showTimestamp(event)">

<p>Click in the document. An alert
box will alert the timestamp.</p>

</body>
</html>

Try it yourself »


Event Object Reference Event Object
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$7.95/mo SEO Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Free Website Templates Free CSS Templates
Make Your Own Website
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE