Class that handles all date related (calculation) functions. More...
#include <script_date.hpp>
Static Public Member Functions | |
static int32 | GetCurrentDate () |
Get the current date. | |
static int32 | GetYear (int32 date) |
Get the year of the given date. | |
static int32 | GetMonth (int32 date) |
Get the month of the given date. | |
static int32 | GetDayOfMonth (int32 date) |
Get the day (of the month) of the given date. | |
static int32 | GetDate (int32 year, int32 month, int32 day_of_month) |
Get the date given a year, month and day of month. |
Class that handles all date related (calculation) functions.
ai
Definition at line 28 of file script_date.hpp.
int32 ScriptDate::GetCurrentDate | ( | ) | [static] |
Get the current date.
This is the number of days since epoch under the assumption that there is a leap year every 4 years, except when dividable by 100 but not by 400.
Definition at line 16 of file script_date.cpp.
References _date.
Referenced by ScriptSubsidy::GetExpireDate().
int32 ScriptDate::GetDate | ( | int32 | year, | |
int32 | month, | |||
int32 | day_of_month | |||
) | [static] |
Get the date given a year, month and day of month.
year | The year of the to-be determined date. | |
month | The month of the to-be determined date. | |
day_of_month | The day of month of the to-be determined date. |
Definition at line 48 of file script_date.cpp.
References ConvertYMDToDate(), and MAX_YEAR.
Referenced by ScriptSubsidy::GetExpireDate().
int32 ScriptDate::GetDayOfMonth | ( | int32 | date | ) | [static] |
Get the day (of the month) of the given date.
date | The date to get the day of. |
Definition at line 39 of file script_date.cpp.
References ConvertDateToYMD().
int32 ScriptDate::GetMonth | ( | int32 | date | ) | [static] |
Get the month of the given date.
date | The date to get the month of. |
Definition at line 30 of file script_date.cpp.
References ConvertDateToYMD().
Referenced by ScriptSubsidy::GetExpireDate().
int32 ScriptDate::GetYear | ( | int32 | date | ) | [static] |
Get the year of the given date.
date | The date to get the year of. |
Definition at line 21 of file script_date.cpp.
References ConvertDateToYMD().
Referenced by ScriptSubsidy::GetExpireDate().