This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
+4 votes

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

in Engine by (66 points)

1 Answer

+8 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 (66 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, which is great

I found this useful and find the habit of asking and answering your own questions also useful. It's so cheap to post something on a forum and so costly to wait for hours or days for someone to answer that posting in advance is a smart way to document our knowledge.

just what I was looking for, thank you.

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.