pawn Код:
stock mktime(hour, minute, second, day, month, year) // By: Y_Less
{
static const days_of_month[12] =
{
0 * 86400, 31 * 86400, 59 * 86400,
90 * 86400, 120 * 86400, 151 * 86400,
181 * 86400, 212 * 86400, 243 * 86400,
273 * 86400, 304 * 86400, 334 * 86400
};
static
lMonth, lYear, lMonthS, lYearS;
if (year != lYear)
{
year -= 1970;
lYearS = year * 31536000;
lYearS += 86400 * (year / 4);
year += 70;
lYearS -= (year / 100) * 86400;
year += 300;
lYearS += (year / 400) * 86400;
year += 1600;
lYear = year;
}
if (month != lMonth)
{
--month;
lMonthS = days_of_month[month];
if (IsLeapYear(year) && month >= 2)
{
lMonthS += 86400;
}
lMonth = month + 1;
}
day = (day - 1) * 86400;
hour = (hour - (0 TIME_ZONE)) * 3600;
minute = minute * 60;
return lYearS + lMonthS + day + hour + minute + second;
}