Alright so as the title say i would like the get the client’s time in hms format (hours:minute:seconds)
Untill now i was using this code :
local function getTime(sec)
return ("%.2d:%.2d:%.2d"):format(sec/3600%24, sec/60%60, sec%60)
end
print(getTime(tick()))
-- would return : xx:xx:xx | eq : 16:53:37
but it doesn’t get the actual Client’s time (for me it’s 1 hour late - fixed eq would be : 17:53:37 and no i’m not gonna as +1 dont answer that pls it might be different for others)
Help ! also maybe i’ve misunderstood something if so then please explain me btw important detail i want to get it on the server but it deosn’t matter much after all cuz we can always get it from clien side and transfer it to server so nvm not so important
Well i didn’t knew tick() was deprecated but it does not fix my issue tho i obtained
Times that are still wrong… even after trying os.clock() and os.time() perhaps my code is wrong to begin with
local localTime = DateTime.now():ToLocalTime()
local hour = localTime.Hour
local minutes = localTime.Minute
local seconds = localTime.Second
print(`Current time: {hour}:{minutes}:{seconds}`)