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

How do I use date and or time in a database?

I want to make a daily login reward that players only get once a day.

But everywhere I look it shows something called "os.time" or "os.date" but they are apparently locked by roblox? Where do I get the current time and/or date for my datastore?

1 answer

✓ Accepted answer

We currently do not have access to os.date so we need to use os.time()/tick() which is epoch time. os.time returns the number of seconds since the epoch (1 January 1970, 00:00:00)

To work this out you would need to calculate how many seconds in year, month day ect.

Here are some links to help:-

how-do-you-get-the-date-and-time-from-unix-epoch-time)

ostime-how-to-use-it

Also I have made a module there are better mathematical approaches to this but I chose a logical approach.

There are also other questions on the SH forum which may help.

Hope this helps

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