34 return yr % 4 == 0 && (yr % 100 != 0 || yr % 400 == 0);
Year _cur_year
Current year, starting at 0.
DateFract _date_fract
Fractional part of the day.
int32 Year
Type for the year, note: 0 based, i.e. starts at the year 0.
Date _date
Current date in days (day counter)
uint16 _tick_counter
Ever incrementing (and sometimes wrapping) tick counter for setting off various events.
Data structure to convert between Date and triplet (year, month, and day).
uint16 DateFract
The fraction of a date we're in, i.e. the number of ticks since the last date changeover.
Month _cur_month
Current month (0..11)
uint8 Month
Type for the month, note: 0 based, i.e. 0 = January, 11 = December.
void ConvertDateToYMD(Date date, YearMonthDay *ymd)
Converts a Date to a Year, Month & Day.
static bool IsLeapYear(Year yr)
Checks whether the given year is a leap year or not.
Date ConvertYMDToDate(Year year, Month month, Day day)
Converts a tuple of Year, Month and Day to a Date.
uint8 Day
Type for the day of the month, note: 1 based, first day of a month is 1.
Types related to the dates in OpenTTD.
int32 Date
The type to store our dates in.
void SetDate(Date date, DateFract fract)
Set the date.