This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

timestamp

Summary

Represents the time when the Position object was acquired, represented as a DOMTimeStamp.

Property of apis/geolocation/Positionapis/geolocation/Position

Syntax

Note: This property is read-only.

var result = Position.timestamp;

Return Value

Returns an object of type

DOMTimeStamp

Examples

//Assuming the variable fresh_threshold has been set
if (position.timestamp < fresh_threshold) {
   // The position is relatively recent.
   } else {
   // The position is potentially outdated.
   }

Related specifications

W3C Geolocation Specification
W3C Editor’s Draft

Attributions