Is os.time() reliable?

I know that is.time() used to be unreliable. Is it synced across servers yet? If not, then how can I get time that is synced across servers?

From what I’ve heard, tick() is a better alternative for os.time() I don’t know why but I heard it’s better than this.

I think tick() is deprecated? Also I am pretty sure tick uses local time zone.

tick() returns the total of time that’s passed since January 1st, 1970.

Yes, but that didn’t happen all at the same time. I am 99 percent sure tick is based off of local time zones. Also, it’s deprecated anyways, so I won’t be using it.

It’s the other way actually. os.time() is more reliable since it returns the time passed since January 1st, 1970 in a fixed time zone (UTC/GMT time zone) where tick() return the time passed since January 1st, 1970 on the time zone that operating system uses.

2 Likes

Thank you for the information. I’m sorry that I’ve spread misinformations.

No worries, at least you learned a new thing now today.

No, it doesn’t seem as os.time() was fixed, was this for your session locking module and backups thing? I was looking through ProfileService and it will assume that a profile is dead only after 30 MINUTES of the profile being saved.

I bumped this because I’m still confused. I had bumped the bug report from that and it got closed and I couldn’t get an answer.

I’ve also asked loleris about it on his post, he said he wouldn’t change it until there’s solid proof that this isn’t an issue anymore.

Also you might be able to use some API using HTTPService to get a value if it’s unsynced still.

The people that were mostly suffering from this were bigger developers with bigger games, but I haven’t seen anything from them at all.

I would try to build anything that depends on os.time() with that in mind.

Edit: tried contacting one of the devs to ask him about it.

2 Likes

I am 99 percent sure that os.time returns the time since January 1, 1970, in UTC time. This would mean that it would be synced across each server. Proof: os | Roblox Creator Documentation

I never had any experience with os.time being unreliable, it used to be but engineers months ago claimed that they fixed the problem.