+4 votes

The question is pretty simple. How can I get the current UNIX timestamp in seconds in GDScript?

in Engine by (58 points)

1 Answer

+4 votes
Best answer

It's as simple as OS.get_unix_time(). It will return an int being the number of seconds since January 1st, 1970, AKA the UNIX epoch.

by (58 points)
selected by

why are you asking and answering your own questions? :)

It's an usual thing on stackoverflow, and as I saw that some people were doing it here, too, I jumped onto the bandwagon :)

oh, ok haha :D

@Howl ~ Just make sure not to overuse this ;) better to answer questions on-demand than have many useless questions (I'm NOT implying that this question is useless)

I found this useful. Thanks!

When there is no one asking because the question looks very noob, one can ask and answer by himself

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 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 webmaster@godotengine.org with your username.