How to get Time/Data

I do this to get the Time with the TimeZone 1/German TimeZone:

	local timeZone = 1
	local msPerHour = 1000 * 60 * 60

	runService.Heartbeat:Connect(function()
		
		local dataTime = DateTime.now().UnixTimestampMillis / msPerHour + timeZone
		
		game.Lighting.ClockTime = dataTime % 24

	end)

How could i get the Data from the German TimeZone like 10.01.2023?

I suggest reading through this article.

1 Like

I did, but i didnt saw how to convert just the Date to German TimeZone

Using it on the client should return your time. Look through the formatting in the article and test In Studio (and possibly in a live game) if it works. You want to convert something like GMT + 1 = 13:00 → GMT + 3 = 15:00?

1 Like

Could this post fix your issue, potentially?

1 Like

I want to do it on the Server and i want to convert it to GMT + 1

This doesnt work


You’d have to use RemoteEvents for client-server communication, as it is required to do this. What exactly do you want to do if that post didn’t fix it?

I think i can also do it on the Server, when i print os.date, it will print the Date with the Time correctly but i want to just show the Date with the German Timezone and what do you mean, do you mean what i want to archivie?

Yes, I still don’t understand what you’re trying to achieve. You want to compare timezones…?

I found the Sulotion, i think: print(os.date("%x", os.time()+3600))

Thanks for your help.

Could using a Get request using this post possibly help you?


Oh, I’m glad I tried to help then.

1 Like

This might not work for other people. You’d have to get the UTC time then convert to german time.

yeah that was what i was trying to do and i did it with os.date and os.time and added 3600 seconds

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