1
0
Fork 0
forked from Simnation/Main
Main/resources/[tools]/cc-chat-1/client/main.lua

23 lines
644 B
Lua
Raw Permalink Normal View History

2025-08-12 17:42:27 +02:00
function getTimestamp()
local meridiem = 'AM'
year , month , day , hour , minute , second = ''
if GetGameName() == 'fivem' then
year , month , day , hour , minute , second = GetLocalTime()
elseif GetGameName() == 'redm' then
year , month , day , hour , minute , second = GetPosixTime()
end
if hour >= 13 then
hour = hour - 12
meridiem = 'PM'
end
if hour == 12 then
meridiem = 'PM'
end
if minute <= 9 then
minute = '0' .. minute
end
timestamp = hour .. ':' .. minute .. ' ' .. meridiem
return timestamp
end
exports('getTimestamp', getTimestamp)