Skip to content

Instantly share code, notes, and snippets.

@Razzlegames
Last active March 5, 2016 18:52
Show Gist options
  • Save Razzlegames/a3b5b54188d7994bccb6 to your computer and use it in GitHub Desktop.
Save Razzlegames/a3b5b54188d7994bccb6 to your computer and use it in GitHub Desktop.
extends Spatial
func _ready():
set_process(true)
pass
func _process(delta):
# Raw epoc time (in utc)
var time = OS.get_unix_time()
# Human readable dictionary in UTC with dict["hour"]
# dict["minute"] etc... see comment
var dict = OS.get_time_from_unix_time(time)
print(dict)
# dictionary contents will be formated as:
# (day:5), (hour:18), (minute:49), (month:2), (second:51), (weekday:6), (year:2016)
@Razzlegames
Copy link
Author

[Corrected]
Example output:
(day:5), (hour:18), (minute:49), (month:2), (second:51), (weekday:6), (year:2016)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment