date_type.h
Go to the documentation of this file.00001
00002
00005 #ifndef DATE_TYPE_H
00006 #define DATE_TYPE_H
00007
00014 enum {
00015 DAY_TICKS = 74,
00016 DAYS_IN_YEAR = 365,
00017 DAYS_IN_LEAP_YEAR = 366,
00018 };
00019
00020
00021
00022
00023
00024
00025
00026
00028 #define ORIGINAL_BASE_YEAR 1920
00029
00030 #define ORIGINAL_END_YEAR 2051
00031
00032 #define ORIGINAL_MAX_YEAR 2090
00033
00038 #define DAYS_TILL_ORIGINAL_BASE_YEAR (DAYS_IN_YEAR * ORIGINAL_BASE_YEAR + ORIGINAL_BASE_YEAR / 4 - ORIGINAL_BASE_YEAR / 100 + ORIGINAL_BASE_YEAR / 400)
00039
00040
00041 #define MIN_YEAR 0
00042
00043
00044 #define MAX_YEAR 5000000
00045
00046 typedef int32 Date;
00047 typedef uint16 DateFract;
00048
00049 typedef int32 Year;
00050 typedef uint8 Month;
00051 typedef uint8 Day;
00052
00057 struct YearMonthDay {
00058 Year year;
00059 Month month;
00060 Day day;
00061 };
00062
00063 static const Year INVALID_YEAR = -1;
00064 static const Date INVALID_DATE = -1;
00065
00066 #endif