Transform seconds into english words (days, hours, etc)

time:seconds_to_words(INT $seconds) : STRING

time:seconds_to_words(706160)
#=> "8 days, 4 hours, 9 minutes, 20 seconds"

time:seconds_to_words(398)
#=> "6 minutes, 38 seconds"

time:seconds_to_words(9898)
#=> "2 hours, 44 minutes, 58 seconds"

time:seconds_to_words(39898888)
#=> "461 days, 19 hours, 1 minute, 28 seconds"

time:seconds_to_words(0)
#=> "now"

time:seconds_to_words(-10898)
#=> "3 hours, 1 minute, 38 seconds"

# days since Unix Epoch started
time:seconds_to_words(time:format_unix())
#> "17163 days, 18 hours, 8 minutes, 38 seconds"

Copyright ©2013-2022 SunSed®. All rights reserved.