IsDateAndTimeInThePast
#1

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);
Reply
#2

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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)