03.06.2011, 17:26
PHP Code:
stock DatesTime(Start[], End[],&offest)
{
new dtmp[256], idx1, idx2;
dtmp = strtok(Start, idx1, '.');
new StartDay = strval(dtmp);
dtmp = strtok(Start, idx1, '.');
new StartMonth = strval(dtmp);
dtmp = strtok(Start, idx1, '.');
new StartYear = strval(dtmp);
dtmp = strtok(End, idx2, '.');
new EndDay = strval(dtmp);
dtmp = strtok(End, idx2, '.');
new EndMonth = strval(dtmp);
dtmp = strtok(End, idx2, '.');
new EndYear = strval(dtmp);
new init_date = mktime(12,0,0,StartDay,StartMonth,StartYear);
new dest_date = mktime(12,0,0,EndDay,EndMonth,EndYear);
offest = dest_date - init_date;
offest = floatround(offest/60/60/24, floatround_floor);
return 1;
}