date_type.h
Go to the documentation of this file.00001
00002
00005 #ifndef DATE_TYPE_H
00006 #define DATE_TYPE_H
00007
00014 #define DAY_TICKS 74
00015
00016
00017
00018
00019
00020
00021
00022
00024 #define ORIGINAL_BASE_YEAR 1920
00025
00026 #define ORIGINAL_MAX_YEAR 2090
00027
00032 #define DAYS_TILL_ORIGINAL_BASE_YEAR (365 * ORIGINAL_BASE_YEAR + ORIGINAL_BASE_YEAR / 4 - ORIGINAL_BASE_YEAR / 100 + ORIGINAL_BASE_YEAR / 400)
00033
00034
00035 #define MIN_YEAR 0
00036
00037
00038 #define MAX_YEAR 5000000
00039
00040 typedef int32 Date;
00041 typedef uint16 DateFract;
00042
00043 typedef int32 Year;
00044 typedef uint8 Month;
00045 typedef uint8 Day;
00046
00047 struct YearMonthDay {
00048 Year year;
00049 Month month;
00050 Day day;
00051 };
00052
00053 static const Year INVALID_YEAR = -1;
00054 static const Date INVALID_DATE = -1;
00055
00056 #endif