Timestamp | Seconds - 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: Timestamp | Seconds (
/showthread.php?tid=543206)
Timestamp | Seconds -
CIBERKILLER - 25.10.2014
Hello!
I wanted to ask how to calculate a timestamp within seconds.
The end should look like that (You're still day: hour: minute: second locked!)
I can already calculate days, hours and minutes)
Код:
new days,hours,mins,seconds,wartezeit = wert,restzeit= wartezeit -gettime();
days = floatround(restzeit / 86400,floatround_floor),
hours = restzeit - (days * 86400),
hours = floatround(hours / 3600,floatround_floor),
mins = restzeit - ( (days * 86400) + (hours * 3600) ),
mins = floatround(mins / 60,floatround_floor);
But second? No plan
I ask for help
PS: Sorry for my bad English
Re: Timestamp | Seconds -
Mic_H - 25.10.2014
Seconds = restzeit%60 [Remainder]
Mins = (restzeit/60)%60
Hours = ((restzeit/60)/60)%24
Days = ((restzeit/60)/60)/24
TEST IT >
Код:
new DATE=999999;
printf("Days: %i Hours: %i Minutes: %i Seconds: %i", ((DATE/60)/60)/24,((DATE/60)/60)%24,(DATE/60)%60, DATE%60);