getLocalTime
GET_LOCAL_TIME0x50C7A99057A69748The GTA V native GET_LOCAL_TIME of the CLOCK namespace, as LS:MP client scripts call it: the global function getLocalTime, in JavaScript and in Lua.
getLocalTime(): [
year: number,
month: number,
day: number,
hour: number,
minute: number,
second: number
]getLocalTime(): integer, integer, integer, integer, integer, integerUsage
JavaScript
const [year, month, day, hour, minute, second] = getLocalTime();Lua
local year, month, day, hour, minute, second = getLocalTime()Parameters
None. The game writes the outputs: they are handed back, not passed in.
Returns
6 values, in this order: an array in JavaScript, multiple return values in Lua.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | year | int | number | integer | output |
| 2 | month | int | number | integer | output |
| 3 | day | int | number | integer | output |
| 4 | hour | int | number | integer | output |
| 5 | minute | int | number | integer | output |
| 6 | second | int | number | integer | output |
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Gets local system time as year, month, day, hour, minute and second.
Example usage:
int year;
int month;
int day;
int hour;
int minute;
int second;or use std::tm struct
getLocalTime(&year, &month, &day, &hour, &minute, &second);Reference
- Namespace
- Clock CLOCK
- In the game
void GET_LOCAL_TIME(int* year, int* month, int* day, int* hour, int* minute, int* second)- Hash
0x50C7A99057A69748