|
OpenTTD AI API
1.10.1
|
Class that handles all date related (calculation) functions. More...
Public Types | |
| enum | Date { DATE_INVALID } |
| Date data type is an integer value. More... | |
Static Public Member Functions | |
| static bool | IsValidDate (Date date) |
| Validates if a date value represent a valid date. More... | |
| static Date | GetCurrentDate () |
| Get the current date. More... | |
| static int32 | GetYear (Date date) |
| Get the year of the given date. More... | |
| static int32 | GetMonth (Date date) |
| Get the month of the given date. More... | |
| static int32 | GetDayOfMonth (Date date) |
| Get the day (of the month) of the given date. More... | |
| static Date | GetDate (int32 year, int32 month, int32 day_of_month) |
| Get the date given a year, month and day of month. More... | |
Class that handles all date related (calculation) functions.
| enum AIDate::Date |
Date data type is an integer value.
Use AIDate::GetDate to compose valid date values for a known year, month and day.
| Enumerator | |
|---|---|
| DATE_INVALID | A value representing an invalid date. |
|
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.
|
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. |
|
static |
Get the day (of the month) of the given date.
| date | The date to get the day of. |
|
static |
Get the month of the given date.
| date | The date to get the month of. |
|
static |
Get the year of the given date.
| date | The date to get the year of. |
|
static |
Validates if a date value represent a valid date.
| date | The date to validate. |
1.8.13