Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # Usage:
- # fmt_time SECONDS
- #
- # Examples:
- # $ fmt_time 90
- # 0:01:30
- #
- # $ fmt_time $((60 * 60))
- # 1:00:00
- #
- # $ fmt_time $((60 * 60 * 24 * 400))
- # 400 days, 0:00:00
- #
- fmt_time() { python -c "import datetime; print datetime.timedelta(seconds=$1)"; }
- [[ $BASH_SOURCE = $0 ]] && fmt_time "$1"
Add Comment
Please, Sign In to add comment