Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML DOM Geolocation timestamp Property

Improve Article
Save Article
  • Last Updated : 01 Jun, 2022
Improve Article
Save Article

In this article, we will discuss the Geolocation timestamp property. Geolocation in HTML is used to get the geographical position of a user. The getCurrentPosition() method, in this geolocation, returns an object on success.



Return Value:- This geolocation property returns an object on success.

Example: The following HTML code returns the timestamp.


<!DOCTYPE html>
    <h2 style="color:green">
        <b>Displaying Timestamp</b>
    <button onclick="getlocation()">
        Click Me
    <p id="paraID"></p>
        var variable1 = document.getElementById("paraID");
        function getlocation() {
        function showLoc(pos) {
                = "Timestamp: " + pos.timestamp;


Supported Browsers:

  • Google Chrome 5 and above
  • Edge 12 and above
  • Firefox 3.5 and above
  • Internet Explorer 9 and above
  • Opera 16 and above
  • Safari 5 and above
My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!