[READ-ONLY] Mirror of https://github.com/thoda-dev/DualUniverse. DualUniverse scripts
0

Configure Feed

Select the types of activity you want to include in your feed.

Create TimeScript.lua

authored by

Thomas and committed by
GitHub
(Sep 30, 2020, 10:37 AM +0200) 1cad651f 8378624c

+13
+13
TimeScript/TimeScript.lua
··· 1 + summer_time = true --export 2 + 3 + function getTimeTable(time) 4 + local additionnal_hour = 0 5 + if summer_time then additionnal_hour = 1 end 6 + local T = math.floor(time) % (3600*24) 7 + return {math.floor(T/3600+additionnal_hour)%24, math.floor(T%3600/60), math.floor(T%60)} 8 + end 9 + 10 + function getTimeString(time) 11 + local timeTable = getTimeTable(time) 12 + return string.format("%02d:%02d:%02d",timeTable[1],timeTable[2],timeTable[3]) 13 + end