SA-MP Forums Archive
Time format help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Time format help (/showthread.php?tid=594085)



Time format help - Cr4nh - 13.11.2015

Hello, i have log system but i have problem.

When is time: 19:36:04 , log save 19:46:4

i want make when is 19:36:04 to save 19:36:04.

Here is for connection log.


Код:
format(logpc,sizeof logpc,"[%d/%d/%d]-[%d:%d:%d] | CONNECT | IGRAC: %s | ID: %d | IP: %s |", dan, mjesec, godina, sat, minut, sekund, GetName(playerid), playerid, getip);



Re: Time format help - Ahmad45123 - 13.11.2015

PHP код:
new yearmonthday;
getdate(yearmonthday);
new 
hourminutesecond;
gettime(hourminutesecond); 



Re: Time format help - 7days7 - 13.11.2015

It's very simple. Apply 02%d for examle:
Quote:

format(logpc,sizeof logpc,"[%d/02%d/02%d]-[02%d:02%d:02%d] | CONNECT | IGRAC: %s | ID: %d | IP: %s |", dan, mjesec, godina, sat, minut, sekund, GetName(playerid), playerid, getip);




Re: Time format help - DeathCore - 13.11.2015

Код HTML:
format(logpc,sizeof logpc,"[%d/%d/%d]-[%02d:%02d:%02d] | CONNECT | IGRAC: %s | ID: %d | IP: %s |", dan, mjesec, godina, sat, minut, sekund, GetName(playerid), playerid, getip);
Your welcome.


Re: Time format help - Cr4nh - 13.11.2015

Thanks all rep+