Tick() appears to be outputting the incorrect time on the Roblox client

Hey everyone!

I have been experiencing what seems to be a Roblox bug where tick() is incorrect on the cleint.

I have here a screenshot of what Roblox has printed is the tick() alongisde what the actual tick is.

The actual tick should be 1732525798, but on Roblox is is 1732568996 (difference of ~43200)

This bug does not seem to occur in Roblox studio.

Has anyone else experienced this? Anyone got a fix?

My testing code:

while true do
	task.wait(1)
	print(tick())
end

Thanks.

Edit: This was not occurring in Roblox studio before but now it is!

tick() uses the system’s timezone, so it’s not consistent across the Roblox’s servers and your device. It works the way you’d expect in studio because studio makes a local server using your system, including its timezone

  • os.time() will be the expected Unix Timestamp, but does not have millisecond precision (canonical method)
    • client and server align
  • workspace:GetServerTimeNow() will be the expected Unix Timestamp, with millisecond precision
    • client and server align
  • os.clock() has millisecond precision (canonical method for benchmarking)
    • client and server do not align
    • server uses time since server start
    • client uses CPU time
6 Likes

Thanks so much! Had no idea tick() was localised… :face_with_spiral_eyes:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.