THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| #!/usr/bin/ruby | |
| require 'time' | |
| def format_time(seconds) | |
| hours = (seconds / 3600).to_i | |
| minutes = ((seconds % 3600) / 60).to_i | |
| seconds = (seconds % 60).to_i | |
| minutes = "0#{minutes}" if minutes < 10 | |
| seconds = "0#{seconds}" if seconds < 10 |