Need_Help_Function!gettime();getdate();
#1

new Hour, Minute, Second;
gettime(Hour, Minute, Second);
printf("%02d:%02d:%02d", Hour, Minute, Second);

new SecondsA = gettime();
printf("Seconds since midnight 1st January 1970: %d", SecondsA);
how_to_convert_SecondsA_to_Hour,Minute,Second?



new Year, Month, Day;
getdate(Year, Month, Day);
printf("%02d/%02d/%d", Day, Month, Year);

new DaysA = getdate();
printf("Days since the start of the year: %d", DaysA);
how_to_convert_DaysA_to_Month,Day?
Reply
#2

pawn Код:
new date[3], time[3];
gettime(time[0], time[1], time[2]);
getdate(date[0], date[1], date[2]);
printf("Date + Time: %02d-%02d-%04d %02d:%02d:%02d", date[2], date[1], date[0], time[0], time[1], time[2]);
dd-mm-yyyy hh:mm:ss format
Reply
#3

how_to_convert_DaysA_to_Month,Day!(LookUP)
Reply
#4

What's the point when you already have a function to get the time and date? If you want to save on variables, then I'll have to dissapoint you, as writing a whole new function for it would require more variables and more processing time.
Reply
#5

If you want those days and month, use the f*cking parameters!
https://sampwiki.blast.hk/wiki/Getdate
I can see you looked on wiki:
Quote:

new Days = getdate();
printf("Days since the start of the year: %d", Days);

But did you for godsake took a look above it?
Quote:

new Year, Month, Day;
getdate(Year, Month, Day);
printf("%02d/%02d/%d", Day, Month, Year);

Use that then!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)