Help with client/server time

Hi,

I am firing a remote event to the server with the client’s tick (playerTime = tick()). I know that the server’s timezone can be different from the client’s timezone which would affect the tick()'s. So what I did was convert the seconds to hours so I can use it to get the seconds (since seconds are the same in all timezones). Subtracting the servers seconds to the clients seconds should give me the travel time from client to server but it’s giving me some wacky numbers. Also, this works perfectly in studio but not in-game. Can someone tell me what I’m missing?

event.OnServerEvent:Connect(function(player, playerTime)
      
       local clientHours = playerTime / 3600
       local clientMinutes = (clientHours % 1) * 60
       local clientSeconds = (clientMinutes % 1) * 60
    
       local serverHours = endTime / 3600
       local serverMinutes = (serverHours % 1) * 60
       local serverSeconds = (serverMinutes % 1) * 60
        
       local timeDifference = serverSeconds - clientSeconds

end)

This topic was automatically closed after 3 minutes. New replies are no longer allowed.