Timestamp | Seconds
#1

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
Reply
#2

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)