Convert os.time to players timezone

Hey everybody, I made it so when a player buys a gamepass, the gamepass works for 30 days and then expires. But I want it to show when the gamepass will expire.

When the player buys the gamepass, “os.time() + 2592000” is added to the datastore, but how do I convert this to the players timezone?

Should return a table with .Year .Month etc values based on the local time of the machine running the code.

I just get returned this

That is because it returns a table.


This should print the hour of the local timezone.

Look in the documentation @Wigglyaa provided you with for more info.

Thanks, it works.

I did change part of the code though to


Not an answer to your question, as that was already solved, but:

Why don’t you just enable private servers for the game, set the price to what you want it to be, and let players do it that way? It lets Roblox handle everything.

Oh, the game is set to paid access, so you can’t enable private servers but I still want players to be able to have their own private server.

Oh I see. That explains why you needed it then!

1 Like

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