--- title: GeolocationPosition.timestamp slug: Web/API/GeolocationPosition/timestamp translation_of: Web/API/GeolocationPosition/timestamp original_slug: Web/API/GeolocationPosition/获取该位置时的时间戳 ---
{{securecontext_header}}{{APIRef("Geolocation API")}}

The GeolocationPosition.timestamp 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.

Syntax

var timestamp = geolocationPositionInstance.timestamp

Value

A {{domxref("DOMTimeStamp")}} object instance.

Specifications

Specification Status Comment
{{SpecName('Geolocation', '#dom-geolocationposition-timestamp', 'GeolocationPosition.timestamp')}} {{Spec2('Geolocation')}} Initial definition

Browser compatibility

{{Compat("api.GeolocationPosition.timestamp")}}

See also