Time::getLocalTimeGmt
Not available on SYNC MP yet
This member is part of the RAGE:MP API but SYNC MP does not implement it yet (Client-side JavaScript). Calling it does nothing or throws.
JavaScript
Summary
Retrieves the current UTC time, returning an object containing year, month, day, hour, minute, and second.
Syntax
mp.game.time.getLocalTimeGmt(year, month, day, hour, minute, second);
Required Parameters
- year: int - The current year in UTC.
- month: int - The current month in UTC.
- day: int - The current day in UTC.
- hour: int - The current hour in UTC.
- minute: int - The current minute in UTC.
- second: int - The current second in UTC.
Return Value
- Object: Contains the following properties:
* `year`
* `month`
* `day`
* `hour`
* `minute`
* `second`
Example
The following example retrieves the current UTC time and logs it to the chat:
const utcTime = mp.game.time.getLocalTimeGmt();
mp.gui.chat.push(`Current UTC Time: ${utcTime.year}-${utcTime.month}-${utcTime.day} ${utcTime.hour}:${utcTime.minute}:${utcTime.second}`);