20. Dates and calendar values
func run() -> Dictionary:
var date: Dictionary = Time.get_datetime_dict_from_unix_time(0)
return {"year": date["year"], "month": date["month"], "day": date["day"]}Time.get_datetime_dict_from_system returns the current calendar components; an optional UTC flag selects UTC rather than local system time. Time.get_datetime_string_from_system creates a display string. Unix timestamps represent seconds since the epoch.
PCA’s NowUnix, DateTimeNow, DateTimeString and UnixToDateTime are convenience wrappers. UnixToDateTime retains a compatibility UTC parameter, but the conversion itself uses Godot’s UTC timestamp dictionary. Do not use the system calendar clock as an unquestioned gameplay stopwatch.
