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

Function get_readable_time

utils_bot.py:42–58  ·  view source on GitHub ↗
(seconds: int)

Source from the content-addressed store, hash-verified

40
41
42def get_readable_time(seconds: int) -> str:
43 result = ''
44 (days, remainder) = divmod(seconds, 86400)
45 days = int(days)
46 if days != 0:
47 result += f'{days}d'
48 (hours, remainder) = divmod(remainder, 3600)
49 hours = int(hours)
50 if hours != 0:
51 result += f'{hours}h'
52 (minutes, seconds) = divmod(remainder, 60)
53 minutes = int(minutes)
54 if minutes != 0:
55 result += f'{minutes}m'
56 seconds = int(seconds)
57 result += f'{seconds}s'
58 return result
59
60
61

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected