How could I get the real time with am and pm?

So, I’m working on something that will play specific music based on if it’s morning on night.

The issue is I can get the real time, but not the am and pm.
I want it to show the full time. Example: 12:00Am

	local hours = os.date("*t")["hour"]
	local minutes = os.date("*t")["min"]
	local seconds = os.date("*t")["sec"]
	
	local amOrPm = os.date("*t")["%p"] -- issue here
	print(amOrPm) -- prints nil
	
	game.Lighting.TimeOfDay = hours..":"..minutes..":"..seconds

It’s really simple I just don’t remember.

I think you simply have to use os.date("%p").

2 Likes

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