summaryrefslogtreecommitdiff
path: root/src/map/date.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/date.c')
-rw-r--r--src/map/date.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/map/date.c b/src/map/date.c
index 20ab9fe95..b06ec18d6 100644
--- a/src/map/date.c
+++ b/src/map/date.c
@@ -84,6 +84,20 @@ int date_get_dayofweek(void)
return lt->tm_wday;
}
+// Returns YYYYMMDD of now
+int date_get_date(void)
+{
+ time_t t;
+ struct tm * lt;
+ t = time(NULL);
+ lt = localtime(&t);
+
+ return
+ (lt->tm_year + 1900) * 10000 +
+ (lt->tm_mon + 1) * 100 +
+ (lt->tm_mday);
+}
+
/*==========================================
* Star gladiator related checks
*------------------------------------------*/