-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Button for check if GCS Clock is delayed based on TimeAPi #47
base: main
Are you sure you want to change the base?
Conversation
|
@DavideLentini Instead of trying to retrieve the current timezone from the computer and asking the API to provide the current time in that timezone, shouldn't we simply retrieve the current time from the API in UTC and compare that with |
@ntamas |
True, but you can simply specify UTC as the timezone when calling the API, right? |
@ntamas mmm , sorry I guess I don't really understand , |
$ curl -X 'GET' \
'https://timeapi.io/api/time/current/zone?timeZone=UTC' \
-H 'accept: application/json' This gives you the current time in UTC. You can then convert the |
@ntamas Ohh i get it , yes. |
Then I was able to convert the API datetime to UNIX timestamps:
However, if I compare it to new Date().getTime() I get a delay of 1 hour , the reason is probably that I am in UTC+1 . If there is already a delay due to UTC , how can we tell if there is an additional delay? |
@DavideLentini The source of the mismatch you experience is the P.S. I find it strange that a datetime API doesn't provide raw UNIX timestamps in its output. 🤨 Isn't there a query parameter to enable that, or a different service which includes this functionality? 🤔 |
@isti115
I tried to find an API that would return a direct timestamp but with no luck. |
Hi , @ntamas should already know the contents of this PR.
For now the icon of the new button is the same as the “Help” button but you can change it to your liking.
Obviously it is just a beta , and can be improved. Let me know if you may be interested in it ! thanks