aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/geolocationposition/获取该位置时的时间戳/index.html
blob: e4c731f8684165e42d637f4008a9cf85af8b0e7d (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
46
47
48
49
---
title: GeolocationPosition.timestamp
slug: Web/API/GeolocationPosition/获取该位置时的时间戳
translation_of: Web/API/GeolocationPosition/timestamp
---
<div>{{securecontext_header}}{{APIRef("Geolocation API")}}</div>

<p>The <code><strong>GeolocationPosition.timestamp</strong></code> read-only property returns a {{domxref("DOMTimeStamp")}} object, represents the date and the time of the creation of the {{domxref("GeolocationPosition")}} object it belongs to. The precision is to the millisecond.</p>

<h2 id="Syntax">Syntax</h2>

<pre class="notranslate">var timestamp = geolocationPositionInstance.timestamp
</pre>

<h3 id="Value">Value</h3>

<p>A {{domxref("DOMTimeStamp")}} object instance.</p>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('Geolocation', '#dom-geolocationposition-timestamp', 'GeolocationPosition.timestamp')}}</td>
   <td>{{Spec2('Geolocation')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>



<p>{{Compat("api.GeolocationPosition.timestamp")}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li><a href="/en-US/docs/Web/API/Geolocation_API/Using">Using the Geolocation API</a></li>
 <li>{{domxref("GeolocationPosition")}}</li>
</ul>