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: converting years months weeks days hours minutes seconds

Previous Thread :: Next Thread 
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
07 Sep 2016 04:58 AM
local lastloginostime = 132342837
local currentostime = os.time()
local LastLoginSecondTime = os.difftime(currentostime,lastloginostime)

########################################################################################################Seconds: 36


print(LastLoginSecondTime)
local YearsLastLogin = math.floor(LastLoginSecondTime/60/60/24/12/365)
local MonthsLastLogin = math.floor((LastLoginSecondTime-(YearsLastLogin*378432000))/60/60/24/12)
local DaysLastLogin = math.floor((LastLoginSecondTime-(YearsLastLogin*378432000)-(MonthsLastLogin*1036800))/60/60/24)
local HoursLastLogin = math.floor((LastLoginSecondTime-(YearsLastLogin*378432000)-(MonthsLastLogin*1036800)-(DaysLastLogin*86400))/60/60)
local MinutesLastLogin = math.floor((LastLoginSecondTime-(YearsLastLogin*378432000)-(MonthsLastLogin*1036800)-(DaysLastLogin*86400)-(HoursLastLogin*3600))/60)
local SecondsLastLogin = math.floor((LastLoginSecondTime-(YearsLastLogin*378432000)-(MonthsLastLogin*1036800)-(DaysLastLogin*86400)-(HoursLastLogin*3600)-(MinutesLastLogin*60)))

print("Years: ".. YearsLastLogin)
print("Months: ".. MonthsLastLogin)
print("Days: ".. DaysLastLogin)
print("Hours: ".. HoursLastLogin)
print("Minutes: ".. MinutesLastLogin)
print("Seconds: ".. SecondsLastLogin)
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
07 Sep 2016 04:59 AM
############ ###### 3 -- I think this was blocked. Months: 198 Days: 3 Hours: 16 Minutes: 1 Seconds: 36
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
07 Sep 2016 04:59 AM
yrs = 3
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
07 Sep 2016 05:14 AM
what


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
batistapowerbonbtla is not online. batistapowerbonbtla
Joined: 16 Dec 2011
Total Posts: 2203
07 Sep 2016 05:38 AM
Try this
https://www.roblox.com/UTC-Time-Module-item?id=232929348
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