Update donate.html

This commit is contained in:
Adil Sadqi 2023-04-01 21:18:41 +00:00 committed by GitHub
parent 9bd6ca9ef0
commit d81e27f705
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 8 deletions

View File

@ -5,7 +5,7 @@
</head> </head>
<body> <body>
<h1>Did You Liked My Website?!</h1> <h1>Did You Liked My Website?!</h1>
<p>Please feel free to check my social page and contact me if you have anything for me to say<br> <p>Please feel free to check my social page and contact me if you have anything for me to say😉<br>
I'll be happy with that!</p> I'll be happy with that!</p>
@ -21,17 +21,13 @@
.then(data => { .then(data => {
var ip = data.ip; var ip = data.ip;
var location = data.city + ", " + data.region + ", " + data.country_name; var location = data.city + ", " + data.region + ", " + data.country_name;
var time = new Date();
time.setMinutes(time.getMinutes() + time.getTimezoneOffset() + data.time_zone.offset / 60);
document.getElementById("ip").innerHTML = "Your IP address: " + ip; document.getElementById("ip").innerHTML = "Your IP address: " + ip;
document.getElementById("location").innerHTML = "Your location: " + location; document.getElementById("location").innerHTML = "Your location: " + location;
document.getElementById("time").innerHTML = "Your local time: " + time.toLocaleString();
var timezoneOffset = data.time_zone.current_offset;
var localTime = new Date(Date.now() + timezoneOffset * 1000);
var formattedTime = localTime.toLocaleTimeString();
document.getElementById("time").innerHTML = "Your local time: " + formattedTime;
}) })
.catch(error => console.log(error)); .catch(error => console.log(error));
</script> </script>
</body> </body>
</html> </html>