Posts: 117
Threads: 2
Joined: Nov 2009
Reputation:
0
I really extremely terribly suck with mathematics, is there any chance somebody could help me create a function to check if a date is in the past, the function looking something like:
IsDateAndTimeInThePast(day, month, year, minute, hour, second);
Double-O-Seven
Unregistered
Just count the second of the year^^
pawn Код:
new MonthDays[12]=
{
31,//Januar
28,//Februar
31,//Maerz
30,//April
31,//Mai
30,//Juni
31,//Juli
31,//August
30,//September
31,//Oktober
30,//November
31//Dezember
};
stock GetYearSecond()
{
new d,m,y,h,s,ys;
gettime(h,m,s);
ys=s;
ys+=m*60;
ys+=h*60*60;
getdate(y,m,d);
ys+=(d-1)*24*60*60;
for(new i=0;i<(m-1);i++)
ys+=MonthDays[i]*24*60*60;
return ys;
}