Справочник функций
Godot 4 · GDScript · Setup & session
refresh_date
Returns the local device date and time as a formatted string.
Synchronous (returns directly)
Signature
refresh_date() -> StringWhat it does
Formats the device's current local datetime. It is the device clock, not the server clock.
Parameters
This function takes no parameters.
How to call it
Read it any time.
Returns: String, formatted "YYYY-MM-DD HH:MM:SS", from the LOCAL device clock.
Example
print("now: %s" % Gamdato.refresh_date())Use cases
- Timestamp a local log line or a save's 'last played' field.