How do I get the time in a certain time zone?

So, I’m trying to make a report GUI where you can report a player for doing whatever breaks the rules of my experience / Roblox TOS. Everything works fine, but I want to include the date & time EST along with all the other info. I’ve heard of os.time or something like that but it’s the time the client’s computer is set to, so that won’t work.

How do I do that?

1 Like

os.time() in a localscript will return client time. But in a server script should return server machines time, however would still be inconsistent due to the server-location.

What you could try is using HTTP service and GetAsync to get it externally from the web, however this has limitations and could potentially (depending on how many reports happen) cause bugs.

I think due to that you may be best to use OS.Time on the server side.

One other way of implementing this is to have your reports get sent to a Discord Server using a WebHook, discord will automatically time-stamp it (again has limitations due to HTTP service).

1 Like

I know about that, but I want the time to be the same universally. What I mean is that, on Discord, for one person the time stamp would be 4:00PM and for another person it would be 5:00AM since it shows the local time too.
(Probably explained that poorly)

…and I want it to show the same time & date no matter the time zone said person is in.

No, when the Discord message is sent via the WebHook it will show the time the message is received, which effectively is a time-stamp for you?

I see what you mean since it isn’t the same time zone as me (It’s 9:59PM for me right now so the difference is 1 hour judging by the time stamp)
also screenshot was taken at 9:35

I could use some sort of api to get the time though

There’s loads of ways you can do it, Roblox doesn’t make it easy if you don’t want OS time.

Alright, finished the script!
FYI my computer’s time was 1 hour ahead for some reason so Discord showed the actual time stamp for my time zone.