How to use online time and not Os time.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Mora

Hello
I’m what for my game an online hour because if I use the OS one the could change the time of the computer or phone.
Someone knows how to do it.
Thanks

:bust_in_silhouette: Reply From: wyattb

One way to do it is get the time from online NTP servers. Example pool.ntp.org: the internet cluster of ntp servers

Another way could be to use a timer node. At the start of your code capture the ticks and then use timer to keep track of a counter. Compare the sum to the current ticks. If the sum hasn’t drifted by much just reset the start ticks to current ticks otherwise produce error.

https://gdscript.com/solutions/godot-timing-tutorial/