+1 vote

Hi, Is there a example how to use network time protocol NTP to get current time/millis based on user timezone?

thank you

in Engine by (22 points)

1 Answer

0 votes
Best answer
var time = OS.get_datetime()
var dayofweek = time["weekday"]
print(str(dayofweek))

https://docs.godotengine.org/en/stable/classes/class_os.html#class-os-method-get-datetime

originally answered here
https://godotengine.org/qa/9444/how-to-get-day-from-datetime

It seems that if you need more than OS offers you would have to extend python and the MS is probably not going to work. Definitely possible to write a module that uses the internal frame clock along with OS datetime module to track the actual time down to MS.

What are you trying to do?

by (58 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.