Reference des fonctions
GameMaker Studio · GML · Setup & session
gmda_refreshDate
Recomputes and returns the current device date/time as a string.
Synchronous (returns directly)
Signature
gmda_refreshDate() -> stringWhat it does
Formats the device's current local datetime, stores it in the cache, and returns it. It is the device clock, not the server clock.
Parameters
This function takes no parameters.
How to call it
Call it whenever you want a fresh timestamp; read it back later with gmda_getDate() if you do not need to recompute.
Returns: The current datetime string, formatted "YYYY-M-D H:M:S", from the LOCAL device clock.
Example
var now = gmda_refreshDate();
show_debug_message("now: " + now);Use cases
- Timestamp a local log line or a save's last played field.