What would be the cleanest way to convert an amount of seconds to the biggest unit that is not 0 and then display only the significative unit.
Input -> Expected output
1 -> 1s
61 -> 1m
120 -> 2m
3620 -> 1h
86400 -> 1day
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
What would be the cleanest way to convert an amount of seconds to the biggest unit that is not 0 and then display only the significative unit.
Input -> Expected output
1 -> 1s
61 -> 1m
120 -> 2m
3620 -> 1h
86400 -> 1day