jQuery Timestamp Event

Friday, June 22, 2012

The jQuery event timestamp property will return, when the event is triggered, the number of milliseconds since January 1 1970.



eventSpecifies the event to get the timestamp for.

Basic Example

In the following jQuery example, the timestamp event's properties can be accessed to determine when an element was clicked. Try clicking the mouse icon below. The results will be displayed in the div element next to the mouse icon.

<!DOCTYPE html>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
  $("#imgMouse").click(function (e) {
    $("#div1").html("The click ... " + e.timeStamp);
<div id="div1">Click the mouse icon to the left!</div>

< Click the mouse icon to the left!

Did you find the page informational and useful? Share it using one of your favorite social sites.

Recommended Books & Training Resources

HTML CSS and JavaScript Editor Pro jQuery JavaScript and jQuery: The Missing Manual