MCPcopy Create free account
hub / github.com/TechifyBots/Rename-Bot / TimeFormatter

Function TimeFormatter

helper/utils.py:48–58  ·  view source on GitHub ↗
(milliseconds: int)

Source from the content-addressed store, hash-verified

46 return str(round(size, 2)) + " " + Dic_powerN[n] + 'ʙ'
47
48def TimeFormatter(milliseconds: int) -> str:
49 seconds, milliseconds = divmod(int(milliseconds), 1000)
50 minutes, seconds = divmod(seconds, 60)
51 hours, minutes = divmod(minutes, 60)
52 days, hours = divmod(hours, 24)
53 tmp = ((str(days) + "ᴅ, ") if days else "") + \
54 ((str(hours) + "ʜ, ") if hours else "") + \
55 ((str(minutes) + "ᴍ, ") if minutes else "") + \
56 ((str(seconds) + "ꜱ, ") if seconds else "") + \
57 ((str(milliseconds) + "ᴍꜱ, ") if milliseconds else "")
58 return tmp[:-2]
59
60def convert(seconds):
61 seconds = seconds % (24 * 3600)

Callers 1

progress_for_pyrogramFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected