[Ajuda] gettime()
#9

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);
}
Exemplo

pawn Код:
new year, month, day, hour, minute, second;
// Hora de regresso em 504853 segundos
ConvertSeconds(504853, year, month, day, hour, minute, second);
Fonte: https://github.com/Crayder/Time-Conv.../timestamp.inc

Eu nгo falo portuguкs , eu sу vi o meu nome e veio para ajudar. Usando ****** Tradutor.
Reply


Messages In This Thread
gettime() - by F1N4L - 28.03.2016, 12:59
Re: gettime() - by PT - 28.03.2016, 13:47
Re: gettime() - by F1N4L - 28.03.2016, 13:54
Re: gettime() - by PT - 28.03.2016, 13:56
Re: gettime() - by F1N4L - 28.03.2016, 14:03
Re: gettime() - by Dayvison_ - 28.03.2016, 14:20
Re: gettime() - by F1N4L - 28.03.2016, 14:37
Re: gettime() - by ViniBorn - 28.03.2016, 17:48
Re: gettime() - by Crayder - 29.03.2016, 17:56
Re: gettime() - by F1N4L - 29.03.2016, 18:00

Forum Jump:


Users browsing this thread: 1 Guest(s)