MCPcopy Create free account
hub / github.com/TechifyBots/File-Stream-Bot / readable_time

Function readable_time

utils_bot.py:62–78  ·  view source on GitHub ↗
(seconds: int)

Source from the content-addressed store, hash-verified

60
61
62def readable_time(seconds: int) -> str:
63 result = ''
64 (days, remainder) = divmod(seconds, 86400)
65 days = int(days)
66 if days != 0:
67 result += f'{days}d'
68 (hours, remainder) = divmod(remainder, 3600)
69 hours = int(hours)
70 if hours != 0:
71 result += f'{hours}h'
72 (minutes, seconds) = divmod(remainder, 60)
73 minutes = int(minutes)
74 if minutes != 0:
75 result += f'{minutes}m'
76 seconds = int(seconds)
77 result += f'{seconds}s'
78 return result

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected