generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Getting the current month?

Previous Thread :: Next Thread 
MICHEAL1988351 is online. MICHEAL1988351
Joined: 26 Jan 2015
Total Posts: 582
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
noahcoolboy2 is not online. noahcoolboy2
Joined: 06 Aug 2016
Total Posts: 459
16 Apr 2017 06:48 PM
Try

Month = os.time(month)
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
16 Apr 2017 06:50 PM
noah is right

you can fetch several values with os.time


Report Abuse
DarknessSheath is not online. DarknessSheath
Joined: 07 Sep 2014
Total Posts: 255
16 Apr 2017 06:50 PM
If only os.date was included.
Report Abuse
AxonMega is online. 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
noahcoolboy2 is not online. noahcoolboy2
Joined: 06 Aug 2016
Total Posts: 459
16 Apr 2017 06:56 PM
Oh ok
Report Abuse
MICHEAL1988351 is online. MICHEAL1988351
Joined: 26 Jan 2015
Total Posts: 582
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
noahcoolboy2 is not online. noahcoolboy2
Joined: 06 Aug 2016
Total Posts: 459
16 Apr 2017 06:58 PM
But that's when you call without arguments!
Report Abuse
noahcoolboy2 is not online. noahcoolboy2
Joined: 06 Aug 2016
Total Posts: 459
16 Apr 2017 06:59 PM
MICHEAL do you test my first reply?
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
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
MICHEAL1988351 is online. MICHEAL1988351
Joined: 26 Jan 2015
Total Posts: 582
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
MICHEAL1988351 is online. MICHEAL1988351
Joined: 26 Jan 2015
Total Posts: 582
16 Apr 2017 07:01 PM
@aggressive thanks for the open source library I will take a look!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image