Date Problem (+rep)
#5

Quote:
Originally Posted by ScripteRMKD
Посмотреть сообщение
aha and i need to replace the %d with %02d ??
no, you don't have to format it any more cuz it's already been formatted by getdate.

also, "UltraScripter" made a small mistake in the code he posted
Quote:
Originally Posted by UltraScripter
pawn Код:
getdate(day, month, year);
that's just wrong.
the prototype of getdate is as follows
pawn Код:
unsigned int getdate(unsigned int year, unsigned int month, unsigned int day);
//so its actually: year, month, day
his code would produce something like this:
pawn Код:
2014/11/30
here, "day" is actually the year, "month" the month (got that right ^^)
but "year" the day


what you want is to add 5 days to "days" right?
something like this
pawn Код:
new d[3];
    getdate(d[0], d[1], d[2]);
   
    printf("Date: %d/%d/%d",d[2]+5, d[1], d[0]);// +5 for days
it'll print
Date: 35/11/2014
Reply


Messages In This Thread
Date Problem (+rep) - by ScripteRMKD - 30.11.2014, 18:06
Re: Date Problem (+rep) - by UltraScripter - 30.11.2014, 18:09
Re: Date Problem (+rep) - by ScripteRMKD - 30.11.2014, 18:13
Re: Date Problem (+rep) - by UltraScripter - 30.11.2014, 18:17
Re: Date Problem (+rep) - by CutX - 30.11.2014, 18:27
Re: Date Problem (+rep) - by ScripteRMKD - 30.11.2014, 18:37
Re: Date Problem (+rep) - by AnthonyTimmers - 30.11.2014, 21:03
Re: Date Problem (+rep) - by ScripteRMKD - 30.11.2014, 21:36
Re: Date Problem (+rep) - by AnthonyTimmers - 30.11.2014, 21:45
Re: Date Problem (+rep) - by ScripteRMKD - 30.11.2014, 23:16
Re: Date Problem (+rep) - by Threshold - 01.12.2014, 01:53
Re: Date Problem (+rep) - by ScripteRMKD - 01.12.2014, 11:24
Re: Date Problem (+rep) - by ScripteRMKD - 01.12.2014, 11:38
Re: Date Problem (+rep) - by Threshold - 01.12.2014, 11:53
Re: Date Problem (+rep) - by ScripteRMKD - 01.12.2014, 13:31
Re: Date Problem (+rep) - by Threshold - 01.12.2014, 13:52
Re: Date Problem (+rep) - by ScripteRMKD - 01.12.2014, 14:13
Re: Date Problem (+rep) - by ScripteRMKD - 01.12.2014, 17:37
Re: Date Problem (+rep) - by Threshold - 01.12.2014, 22:26
Re: Date Problem (+rep) - by AnthonyTimmers - 01.12.2014, 23:01

Forum Jump:


Users browsing this thread: 1 Guest(s)