11.04.2012, 10:15
Hello,
I need the function GetTimeDifference(minute, second, day, month, year)
This function should return the difference from the current time in minutes.
I have it with days, but minutes would be better for my plan.
Thank you!
I need the function GetTimeDifference(minute, second, day, month, year)
This function should return the difference from the current time in minutes.
I have it with days, but minutes would be better for my plan.
Thank you!
PHP код:
stock GetDateDifference(day, month, year)
{
new tDay, tMonth, tYear, days;
getdate(tYear, tMonth, tDay);
loop_start:
if(day != tDay || month != tMonth || year != tYear)
{
days++;
day++;
if(day>28 && month == 2)
{
day=1;
month++;
}
if(day>30 && (month == 4 || month == 6 || month == 9 || month == 11))
{
day=1;
month++;
}
if(day>31 && (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12))
{
day=1;
month++;
}
if(month>12)
{
day=1;
month=1;
year++;
}
goto loop_start;
}
return days;
}