summaryrefslogtreecommitdiff
path: root/src/map/date.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-08-08 16:48:12 +0200
committerGitHub <noreply@github.com>2017-08-08 16:48:12 +0200
commit89ccf19c2780f80aa475c07fcea5750519266807 (patch)
treedeb8adacb1904b4c86e94e3ab8ce29d4ce862be7 /src/map/date.c
parente1e27fd07bfa1a90eeb2d4bfff32c70258cc07df (diff)
parent544da439e81ff78ec102b754e16b6cc0a28a6d0a (diff)
downloadhercules-89ccf19c2780f80aa475c07fcea5750519266807.tar.gz
hercules-89ccf19c2780f80aa475c07fcea5750519266807.tar.bz2
hercules-89ccf19c2780f80aa475c07fcea5750519266807.tar.xz
hercules-89ccf19c2780f80aa475c07fcea5750519266807.zip
Merge pull request #1686 from guilherme-gm/rodex_
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
*------------------------------------------*/