timeStamp event attribute


timeStamp Event attribute

Definition and usage


timeStamp event attribute returns a timestamp. Indicates the date and time (number of milliseconds since the epoch) when the event occurred.

epoch is an event reference point. Here, it's the time the client started.

Not all systems provide this information, therefore, the timeStamp attribute is not available for all systems/events.

Syntax

event.timeStamp

Example

Example

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script>
function myFunction(e){
	alert(e.timeStamp);
}
</script>
</head>
<body>

<p onclick="myFunction(event)">点击这一段。弹出一个警告框,含有时间戳。</p>

</body>
</html>

Run Instance»

Click the "Run Instance" button to view the online instance


##