ClockClient6 outputs

getPosixTime

GET_POSIX_TIME0xDA488F299A5B164E

The GTA V native GET_POSIX_TIME of the CLOCK namespace, as LS:MP client scripts call it: the global function getPosixTime, in JavaScript and in Lua.

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

Usage

JavaScript
const [year, month, day, hour, minute, second] = getPosixTime();
Lua
local year, month, day, hour, minute, second = getPosixTime()

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 system time as year, month, day, hour, minute and second.

Example usage:

   int year;
int month;
   int day;
 int hour;
int minute;
  int second;

getPosixTime(&year, &month, &day, &hour, &minute, &second);

Reference

Namespace
Clock CLOCK
In the game
void GET_POSIX_TIME(int* year, int* month, int* day, int* hour, int* minute, int* second)
Hash
0xDA488F299A5B164E

Open in the interactive natives reference