summaryrefslogtreecommitdiff
path: root/src/map/date.c
diff options
context:
space:
mode:
authorKirieZ <guilherme.menaldo@outlook.com>2017-07-30 13:45:41 -0300
committerKirieZ <guilherme.menaldo@outlook.com>2017-07-30 13:45:41 -0300
commit544da439e81ff78ec102b754e16b6cc0a28a6d0a (patch)
tree6fef53b94dec9f72b65b39df08fb8eb4160a467f /src/map/date.c
parent71d694baa88d2beb6ec0f89fb2f8b733898acea5 (diff)
downloadhercules-544da439e81ff78ec102b754e16b6cc0a28a6d0a.tar.gz
hercules-544da439e81ff78ec102b754e16b6cc0a28a6d0a.tar.bz2
hercules-544da439e81ff78ec102b754e16b6cc0a28a6d0a.tar.xz
hercules-544da439e81ff78ec102b754e16b6cc0a28a6d0a.zip
Implementation of RoDEX
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
*------------------------------------------*/