+1 vote

I am trying to get the time on the users device in gdscipt when the html5 page is hosted on a server it shows the time of the server. I am using this to get the time:

var timeDict = OS.get_time()
var hour = timeDict.hour
var minute = timeDict.minute
var second = timeDict.second

Thanks in advance

Godot version v3.2.3
in Engine by (13 points)

1 Answer

0 votes

It's possible to get the client's date using the JavaScript singleton. I'm not sure if there's a built in method in GDScript for getting the client's date though.

by (8,150 points)
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.