Safe way to get the GMT time

To add comments, please log in or register
Timo Schroeter
3841
Timo Schroeter  

Hello,

the TimeGMT() method only works when the computer time and the timezone are set up correctly. Is there a way to get the current GMT time without using this method?

Stanislav Korotky
31602
Stanislav Korotky  
Timo Schroeter:

Hello,

the TimeGMT() method only works when the computer time and the timezone are set up correctly. Is there a way to get the current GMT time without using this method?

You can utilize WebRequest and ask some of publicly available services (see examples here). But this will only work in EAs.

Free Rest API to get current time as string (timezone irrelevant)
Free Rest API to get current time as string (timezone irrelevant)
  • stackoverflow.com
I could set this up myself, but the functionality is sooo simple that it seems like someone else probably already did it better and faster than I could with my Rails app. I need the current time as a string. I'd like it to return within less than a second, wherever my visitor happens to be in the world. (I'm making a countdown timer, and it...
William Roeder
19826
William Roeder  
Timo Schroeter: the TimeGMT() method only works when the computer time and the timezone are set up correctly.
Unless you've disabled time synchronization (control panel -> Time -> Internet Time) it will always be correct. Local time settings are irrelevant (correct or not.)
Timo Schroeter
3841
Timo Schroeter  
whroeder1:
Unless you've disabled time synchronization (control panel -> Time -> Internet Time) it will always be correct. Local time settings are irrelevant (correct or not.)
Thanks. I think its the best way and will use this.
To add comments, please log in or register