29.03.2016, 17:56
pawn Код:
stock ConvertSeconds(input, &year, &month, &day, &hour, &minute, &second) {
#define MINUTES_IN_HOUR 60
#define HOURS_IN_DAY 24
#define DAYS_IN_WEEK 7
#define DAYS_IN_MONTH 30
#define DAYS_IN_YEAR 365.2425
second = input % SECONDS_PER_MINUTE;
input /= SECONDS_PER_MINUTE;
minute = input % MINUTES_IN_HOUR;
input /= MINUTES_IN_HOUR;
hour = input % HOURS_IN_DAY;
input /= HOURS_IN_DAY;
day = input % DAYS_IN_WEEK;
input /= DAYS_IN_WEEK;
//week = input & WEEKS_IN_MONTH;
month = input / WEEKS_IN_MONTH;
year = floatround(input / DAYS_IN_YEAR, floatround_floor);
}
pawn Код:
new year, month, day, hour, minute, second;
// Hora de regresso em 504853 segundos
ConvertSeconds(504853, year, month, day, hour, minute, second);
Eu nгo falo portuguкs , eu sу vi o meu nome e veio para ajudar. Usando ****** Tradutor.