--- title: GeolocationPosition.timestamp slug: Web/API/GeolocationPosition/timestamp translation_of: Web/API/GeolocationPosition/timestamp original_slug: Web/API/GeolocationPosition/获取该位置时的时间戳 --- <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>