GetClockHours
Docslocal retval = GetClockHours()Description
Gets the current ingame hour, expressed without zeros. (09:34 will be represented as 9)
Returns
intReturns an integer value.
local retval = GetClockHours()Gets the current ingame hour, expressed without zeros. (09:34 will be represented as 9)
intReturns an integer value.
-- Get formatted game time with AM/PM
local time = QBCore.Functions.GetCurrentTime()
print(time.hour) -- 24h format (0-23)
print(time.formattedHour) -- 12h format (nil if AM)
print(time.min) -- minutes
print(time.formattedMin) -- zero-padded string for < 10
print(time.ampm) -- "AM" or "PM"Combines GetClockHours and GetClockMinutes into a formatted time object with 12-hour conversion and AM/PM indicator.
No snippets yet. Be the first to contribute!