From 10c2e32f4c875eb1eff1942008fa1c8fe14593dc Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Tue, 30 Jun 2015 09:50:12 +0200 Subject: [PATCH] Now pads a 0 to single digit hours. --- code/_helpers/time.dm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/_helpers/time.dm b/code/_helpers/time.dm index 8d37b47f0af..89b5f674f7c 100644 --- a/code/_helpers/time.dm +++ b/code/_helpers/time.dm @@ -8,11 +8,17 @@ var/roundstart_hour = 0 //Returns the world time in english proc/worldtime2text(time = world.time) 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() return num2text((text2num(time2text(world.timeofday, "YYYY"))+544)) + "-" + time2text(world.timeofday, "MM-DD") - + proc/time_stamp() return time2text(world.timeofday, "hh:mm:ss")