Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I get a certain value out of os.date()?

So, how would I be able to use os.date() and get a certain value out of it (in my instance, yday)? It's just a short question :P

1 answer

As stated on the wiki: Format string must be either *t or !*t. *t is local time (only useful on the client), and !*t is UTC. So, when we are grabbing os.date() a format string must be passed to it, use *t if you would like to get local and !*t to grab UTC time.


osDate = os.date(*t)
yDay = osDate.yday

print(yDay)

3 comments

0

2 things wrong. The first parameter is incorrect, it needs to be os.time, and second thing that is incorrect, is that that is not how you get a value out of a dictionary.

0

@hiimgoodpack I think I clearly said OS.DATE. os.time just returns the time in seconds since the Epoch.

0

Unix Epoch*

This discussion is preserved as it was. New answers, comments, and votes are closed.