00001
00002
00003
00004
00005
00007
00008 #include "TimeInfo.h"
00009
00010 TimeInfo::TimeInfo(int date, int time)
00011 {
00012 msec = (time%100)*10;
00013 sec = (time/100)%100;
00014 min = (time/10000)%100;
00015 hour = time/1000000;
00016 day = date%100;
00017 month = (date/100)%100;
00018 year = date/10000;
00019 if (year>50) year+=1900; else year+=2000;
00020 }
00021
00022 bool TimeInfo::operator<(const TimeInfo op2) const
00023 {
00024 if (year<op2.year) return 1;
00025 if (year>op2.year) return 0;
00026 if (month<op2.month) return 1;
00027 if (month>op2.month) return 0;
00028 if (day<op2.day) return 1;
00029 if (day>op2.day) return 0;
00030 if (hour<op2.day) return 1;
00031 if (hour>op2.day) return 0;
00032 if (min<op2.min) return 1;
00033 if (min>op2.min) return 0;
00034 if (sec<op2.sec) return 1;
00035 if (sec>op2.sec) return 0;
00036 if (msec<op2.sec) return 1;
00037 return 0;
00038 }
00039
00040 bool TimeInfo::operator>(const TimeInfo op2) const
00041 {
00042 if (year>op2.year) return 1;
00043 if (year<op2.year) return 0;
00044 if (month>op2.month) return 1;
00045 if (month<op2.month) return 0;
00046 if (day>op2.day) return 1;
00047 if (day<op2.day) return 0;
00048 if (hour>op2.day) return 1;
00049 if (hour<op2.day) return 0;
00050 if (min>op2.min) return 1;
00051 if (min<op2.min) return 0;
00052 if (sec>op2.sec) return 1;
00053 if (sec<op2.sec) return 0;
00054 if (msec>op2.sec) return 1;
00055 return 0;
00056 }
00057