How to know turn"%c") into number

Basically im making a level browser. It has a sorting system, NEWEST and OLDEST. I have the“%c”) information of when the level was made. And I wanna turn that into a number so I can do: level.LayoutOrder=number. As simple as that.

By the way this is an example of what we get from“%c”): “Thu Jun 27 15:33:18 2024”

you can maybe use os.time() since it only has numbers

And It’s going to output this:


Okay that worked, also is there any way of converting os.time() to

Yes, there is!
you can use"*t", Time) again to get the time like this"*t", 1719508584) -- // The time I demonstrated

and it will output this:

	["day"] = 27,
	["hour"] = 19,
	["isdst"] = true,
	["min"] = 16,
	["month"] = 6,
	["sec"] = 24,
	["wday"] = 5,
	["yday"] = 179,
	["year"] = 2024

I did it a bit differently , thanks for the help though! I did something like this:

local formattedDate ="%d.%m.%Y", creationDate)
1 Like

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