Time and Date function
#1

So I'm struggling with this, this function is supposed to give me a time and a date and it works but the only problem is seconds/minutes etc..

So if time is 12:01:20 the function will retrun me this 12:1:20 i don't know why is that, if there is 0 before secon it will left it blank, hope you understand what i'm talking about... :P

pawn Код:
stock TimeDate()
{
    new
        day,
        month,
        year,
        hour,
        minute,
        second,
        string[50];

    getdate(year, month, day);
    gettime(hour, minute, second);

    format(string, sizeof(string), "%d/%d/%d u %d:%d:%d", day, month, year, hour, minute, second);
    return string;
}
Reply


Messages In This Thread
Time and Date function - by ShoortyFl - 22.10.2014, 16:18
Re: Time and Date function - by Jefff - 22.10.2014, 16:28
Re: Time and Date function - by ShoortyFl - 22.10.2014, 16:33
Re: Time and Date function - by Glossy42O - 22.10.2014, 16:37

Forum Jump:


Users browsing this thread: 2 Guest(s)