Compare two dates and times..
#4

I think he's considering a temporary ban function or something.
second=second1-second2;
if(second<0){second+=60;minute1-=1;}
minute=minute1-minute2;
if(minute<0){minute+=60;hour1-=1;}
hour=hour1-hour2;
if(hour<0){hour+=24;day1-=1;}
day=day1-day2;
if(day<0){day+=30;month1-1;} //the 30 depends on the month could be 30, 31, 28, or 29
month=month1-month2;
if(month<0){month+=12;year1-=1;}
year=year1-year2;

Then year,month,day,hour, and minute are set to the difference of time 1 and time 2
Reply


Messages In This Thread
Compare two dates and times.. - by Outbreak - 23.04.2009, 15:05
Re: Compare two dates and times.. - by Rimeau - 23.04.2009, 15:38
Re: Compare two dates and times.. - by ICECOLDKILLAK8 - 23.04.2009, 15:42
Re: Compare two dates and times.. - by Joe Staff - 23.04.2009, 15:55
Re: Compare two dates and times.. - by Outbreak - 25.04.2009, 15:53
Re: Compare two dates and times.. - by Weirdosport - 25.04.2009, 16:11
Re: Compare two dates and times.. - by Joe Staff - 25.04.2009, 20:01
Re: Compare two dates and times.. - by Weirdosport - 25.04.2009, 20:18
Re: Compare two dates and times.. - by Outbreak - 25.04.2009, 23:14
Re: Compare two dates and times.. - by yom - 26.04.2009, 00:06

Forum Jump:


Users browsing this thread: 3 Guest(s)