diff options
Diffstat (limited to 'src/map/date.c')
-rw-r--r-- | src/map/date.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/map/date.c b/src/map/date.c index 5579962bf..9db7155ab 100644 --- a/src/map/date.c +++ b/src/map/date.c @@ -2,8 +2,8 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2012-2015 Hercules Dev Team - * Copyright (C) Athena Dev Teams + * Copyright (C) 2012-2020 Hercules Dev Team + * Copyright (C) Athena Dev Teams * * Hercules is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -77,6 +77,27 @@ int date_get_sec(void) return lt->tm_sec; } +int date_get_dayofweek(void) +{ + time_t t = time(NULL); + struct tm *lt = localtime(&t); + 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 *------------------------------------------*/ |