blob: d01ab1986a0d6941b86ba91785f4c59b6ee4f90b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
---
title: event.timeStamp
slug: Web/API/Event/timeStamp
tags:
- DOM
- Gecko
- Reference_del_DOM_di_Gecko
- Tutte_le_categorie
translation_of: Web/API/Event/timeStamp
---
<p>{{ ApiRef() }}</p>
<h3 id="Sommario" name="Sommario">Sommario</h3>
<p>Restituisce il timestamp (cioè il numero di millisecondi trascorsi dalla Unix Epoch, le ore 00:00:00 del 1/1/1970) corrispondente al momento in cui si è verificato l'evento.</p>
<h3 id="Sintassi" name="Sintassi">Sintassi</h3>
<pre class="eval"><i>ts</i> = event.timeStamp
</pre>
<h3 id="Esempio" name="Esempio">Esempio</h3>
<pre><html>
<head>
<title>esempio di timeStamp</title>
<script type="text/javascript">
var ora = null;
function leggiOrario(evt) {
ora = evt.timeStamp;
document.getElementById("time").firstChild.nodeValue = ora;
}
</script>
</head>
<body onkeypress="leggiOrario(event)">
<p>Premi un tasto per conoscere il timestamp corrente grazie all'evento onkeypress.</p>
<p>timeStamp: <span id="time">-</span></p>
</body>
</html>
</pre>
<h3 id="Note" name="Note">Note</h3>
<p>Il sistema di eventi potrebbe non supportare questa proprietà per ogni possibile tipo di evento.</p>
<h3 id="Specifiche" name="Specifiche">Specifiche</h3>
<p><a class="external" href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-Event-timeStamp">timestamp </a></p>
<p>{{ languages( { "en": "en/DOM/event.timeStamp", "pl": "pl/DOM/event.timeStamp" } ) }}</p>
|