From 5f316b525ab26ed515dc6189b2d56c6191efef67 Mon Sep 17 00:00:00 2001 From: Ren Erthilo Date: Mon, 30 Apr 2012 23:12:14 +0100 Subject: [PATCH] TG: Adds a isDay() function and isAprilFools() macro function which uses isDay() to determine if it is month 4 day 1. GET BUSY. Other shenanigans. Revision: r3361 Author: vageyenaman --- code/defines/procs/time_stamp.dm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/code/defines/procs/time_stamp.dm b/code/defines/procs/time_stamp.dm index a7f8a7205b5..f8e8fa82be8 100644 --- a/code/defines/procs/time_stamp.dm +++ b/code/defines/procs/time_stamp.dm @@ -8,4 +8,17 @@ proc/time_stamp() if(hh < 10) ph = "0" if(mm < 10) pm = "0" if(ss < 10) ps = "0" - return"[ph][hh]:[pm][mm]:[ps][ss]" \ No newline at end of file + return"[ph][hh]:[pm][mm]:[ps][ss]" + + +/* Returns 1 if it is the selected month and day */ +proc/isDay(var/month, var/day) + if(isnum(month) && isnum(day)) + var/MM = text2num(time2text(world.timeofday, "MM")) // get the current month + var/DD = text2num(time2text(world.timeofday, "DD")) // get the current day + if(month == MM && day == DD) + return 1 + + // Uncomment this out when debugging! + //else + //return 1