OpenTTD GameScript API
20240426-master-ga60a81f34e
|
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 SQInteger | GetYear (Date date) |
Get the year of the given date. More... | |
static SQInteger | GetMonth (Date date) |
Get the month of the given date. More... | |
static SQInteger | GetDayOfMonth (Date date) |
Get the day (of the month) of the given date. More... | |
static Date | GetDate (SQInteger year, SQInteger month, SQInteger day_of_month) |
Get the date given a year, month and day of month. More... | |
static SQInteger | GetSystemTime () |
Get the time of the host system. More... | |
Class that handles all date related (calculation) functions.
enum GSDate::Date |
Date data type is an integer value.
Use GSDate::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 time of the host system.
|
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. |