adds seconds_to_time() proc

This commit is contained in:
Birdtalon
2017-09-27 23:58:34 +01:00
parent bf3f968c6f
commit ff5216a2a5
+9 -3
View File
@@ -29,7 +29,7 @@
/proc/time_stamp()
return time2text(world.timeofday, "hh:mm:ss")
/proc/gameTimestamp(format = "hh:mm:ss") // Get the game time in text
return time2text(world.time - timezoneOffset + 432000, format)
@@ -61,6 +61,12 @@ proc/isDay(var/month, var/day)
*/
/proc/stop_watch(wh)
return round(0.1 * (TimeOfGame - wh), 0.1)
/proc/month2number(month)
return month_names.Find(month)
return month_names.Find(month)
//Take a value in seconds and returns a string of minutes and seconds in the format X minute(s) and X seconds.
/proc/seconds_to_time(var/seconds as num)
var/numSeconds = seconds % 60
var/numMinutes = (seconds - numSeconds) / 60
return "[numMinutes] [numMinutes > 1 ? "minutes" : "minute"] and [numSeconds] seconds."