ClockClient6 outputs

getLocalTime

GET_LOCAL_TIME0x50C7A99057A69748

The 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.

SignatureJavaScript
getLocalTime(): [
  year: number,
  month: number,
  day: number,
  hour: number,
  minute: number,
  second: number
]
SignatureLua
getLocalTime(): integer, integer, integer, integer, integer, integer

Usage

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.

#ValueTypeJavaScriptLuaDescription
1yearintnumberintegeroutput
2monthintnumberintegeroutput
3dayintnumberintegeroutput
4hourintnumberintegeroutput
5minuteintnumberintegeroutput
6secondintnumberintegeroutput

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

Open in the interactive natives reference