mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
Now pads a 0 to single digit hours.
This commit is contained in:
@@ -8,11 +8,17 @@ var/roundstart_hour = 0
|
|||||||
//Returns the world time in english
|
//Returns the world time in english
|
||||||
proc/worldtime2text(time = world.time)
|
proc/worldtime2text(time = world.time)
|
||||||
if(!roundstart_hour) roundstart_hour = pick(2,7,12,17)
|
if(!roundstart_hour) roundstart_hour = pick(2,7,12,17)
|
||||||
return "[(round(time / 36000)+roundstart_hour) % 24]:[(time / 600 % 60) < 10 ? add_zero(time / 600 % 60, 1) : time / 600 % 60]"
|
|
||||||
|
var/hour = (round(time / 36000)+roundstart_hour) % 24
|
||||||
|
if(hour < 10) hour = add_zero(hour, 1)
|
||||||
|
var/minute = time / 600 % 60
|
||||||
|
if(minute < 10) minute = add_zero(minute, 1)
|
||||||
|
|
||||||
|
return "[hour]:[minute]"
|
||||||
|
|
||||||
proc/worlddate2text()
|
proc/worlddate2text()
|
||||||
return num2text((text2num(time2text(world.timeofday, "YYYY"))+544)) + "-" + time2text(world.timeofday, "MM-DD")
|
return num2text((text2num(time2text(world.timeofday, "YYYY"))+544)) + "-" + time2text(world.timeofday, "MM-DD")
|
||||||
|
|
||||||
proc/time_stamp()
|
proc/time_stamp()
|
||||||
return time2text(world.timeofday, "hh:mm:ss")
|
return time2text(world.timeofday, "hh:mm:ss")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user