how to calculate hrs through delta time

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By SakuraSen

hello i wish to calculate hrs through delta time for a speedrunuing game im making
but idk how to calculate it
code:

func _process(delta):
time += delta

var mils = fmod(time,1) * 1000
var secs = fmod(time,60)
var mins = fmod(time,60*60)/60
if mins >= 59:
	hr += 1
	mins = 0

time_passage = String( "%02d : %02d : %02d : %04d" % [hr, mins, secs, mils] )

this ?
https://www.youtube.com/watch?v=irI4ebb0JJ0

ramazan | 2022-02-06 20:17

:bust_in_silhouette: Reply From: rossunger
if mins >= 59:
    hr += 1
    mins = 0

doesn’t quite make sense… because mins is the remainder of when you divide the time in seconds by 60.
what you want is something like:
hr = floor(time / 60 / 60)
instead of those 3 lines