XML DOM timeStamp 事件属性

定义和用法

timeStamp 事件属性可返回一个时间戳。指示发生事件的日期和时间(从 epoch 开始的毫秒数)。

epoch 是一个事件参考点。在这里,它是客户机启动的时间。

并非所有系统都提供该信息,因此,timeStamp 属性并非对所有系统/事件都是可用的。

语法

event.timeStamp

实例

下面的例子可获得系统启动开始的事件戳:

<html>

<head>

<script type="text/javascript">

function showTimestamp(event)

  {

  var minutes = 1000*60

  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>

TIY

timestamp event
返回系统启动至今的分钟数(IE 浏览器不支持)。