|
| 17 Nov 2013 11:15 AM |
function GetTime() local Seconds = tick() local Days = Seconds/86400 - 730 local TotalDays = math.floor(Days) local LeapCycles = math.floor(Days/1461) local ExtraYears = math.floor((Days%1461)/365) local Year = LeapCycles*4 + ExtraYears local ExtraDays = TotalDays - LeapCycles*1461 - ExtraYears*365 local Months = {{"Janurary", 31}, {"Feburary" , (ExtraYears == 0 and 29) or 28}, {"March", 31}, {"April", 30}, {"May", 31}, {"June", 30}, {"July", 31}, {"August", 31}, {"September", 30}, {"October", 31}, {"November", 30}, {"December", 31}} local Date, TotalDate, TotalHour, FullDate local Hour = math.floor((Seconds%86400)/3600) local Minute = math.floor((Seconds%3600)/60) if Minute <= 9 then Minute = "0" .. Minute end local Second = math.floor(Seconds%60) if Second <= 9 then Second = "0" .. Second end for i, v in pairs(Months) do if v[2] < ExtraDays then ExtraDays = ExtraDays - v[2] else Date = v[1] .. " " .. ExtraDays .. ", " end end script.Parent.Text = "days : "..TotalDays.." , Hour : "..Hour.." , Minutes : "..Minute.." , Seconds : "..Second end
GetTime()
while wait(1) do GetTime() end |
|
|
| Report Abuse |
|