|
| 16 Apr 2017 06:39 PM |
I am stumped on how I could get the current month (as a number i.e. 1-12) using ROBLOX's os.time() function. If anyone could help me figure this out I would really appreciate it. |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2017 06:48 PM |
Try
Month = os.time(month) |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2017 06:50 PM |
noah is right
you can fetch several values with os.time
|
|
|
| Report Abuse |
|
|
|
| 16 Apr 2017 06:50 PM |
| If only os.date was included. |
|
|
| Report Abuse |
|
|
AxonMega
|
  |
| Joined: 29 Aug 2014 |
| Total Posts: 2403 |
|
|
| 16 Apr 2017 06:53 PM |
| No, that's not how os.time works. You input data such as the month and date and it returns the number of seconds since January 1st, 1970. |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Apr 2017 06:57 PM |
| I am trying to find a way to get the current month based off of those seconds. I managed to get the current year by dividing the seconds by 60^2, and then dividing it again by 24, and looping through the amount of days since 1970 to get 2017, but I am stumped on how to get the month because of the leap years and such. |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2017 06:58 PM |
| But that's when you call without arguments! |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2017 06:59 PM |
| MICHEAL do you test my first reply? |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2017 06:59 PM |
https://www.roblox.com/library/520188882/UNIX-Converter
it's open source so you can use it a look at the code too |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2017 07:00 PM |
| yes, and os.time only takes a table argument of the current date. Thanks for trying to help tho. |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2017 07:01 PM |
| @aggressive thanks for the open source library I will take a look! |
|
|
| Report Abuse |
|
|