SA-MP Forums Archive
[HELP] Get total days... - 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: [HELP] Get total days... (/showthread.php?tid=608262)



[HELP] Get total days... - JR_Junior - 29.05.2016

Hello everybody!

I need to convert the gettime() in days, example:

Using gettime():
LastLogin[playerid] = 1464549743;
ActualLogin[playerid] = 1464549657;

How to get the total days since the last login?
Thanks!


Re: [HELP] Get total days... - Nero_3D - 29.05.2016

You simply divide the difference by 1 day in seconds

days = (ActualLogin[playerid] - LastLogin[playerid]) / (60 * 60 * 24);


Re: [HELP] Get total days... - JR_Junior - 29.05.2016

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
You simply divide the difference by 1 day in seconds

days = (ActualLogin[playerid] - LastLogin[playerid]) / (60 * 60 * 24);
OMG - So simple!
Thank you.. Rep+.