Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Download time with empty minutes and seconds #800

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

p00chie
Copy link

@p00chie p00chie commented Jan 25, 2022

Calculation of
Total time
Download time
Verification time
Repair time
Unpack time
was broken for python3. Everything except hours

def format_time_sec_orig(sec):
    Hour = sec / 3600
    Min = (sec - (sec / 3600) * 3600) / 60
    Sec = (sec - (sec / 3600) * 3600) % 60
    return '%d:%02d:%02d' % (Hour, Min, Sec)
def format_time_sec_new(sec):
    Hour = sec / 3600
    Min = (sec % 3600) / 60
    Sec = (sec % 60)
    return '%d:%02d:%02d' % (Hour, Min, Sec)
print("Orig: " + format_time_sec_orig(int(7199)))
print("New: " + format_time_sec_new(int(7199)))

Output:

Orig: 1:00:00
New: 1:59:59

Before
screenshot 147

After
screenshot 148

Calculation of 
Total time
Download time
Verification time
Repair time
Unpack time
was broken for python3. Everything except hours

def format_time_sec_orig(sec):
    Hour = sec / 3600
    Min = (sec - (sec / 3600) * 3600) / 60
    Sec = (sec - (sec / 3600) * 3600) % 60
    return '%d:%02d:%02d' % (Hour, Min, Sec)

def format_time_sec_new(sec):
    Hour = sec / 3600
    Min = (sec % 3600) / 60
    Sec = (sec % 60)
    return '%d:%02d:%02d' % (Hour, Min, Sec)

print("Orig: " + format_time_sec_orig(int(7199)))
print("New: " + format_time_sec_new(int(7199)))


Output:

1:00:00
1:59:59

Process finished with exit code 0
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant