td.sh
=====

Converting seconds to human readable time duration.

Usage
-----

The basic usage:

    $ ./td.sh 123
    2 minutes 3 seconds

You can source the script to have `print_td` function for better performance:

    $ source td.sh
    $ print_td 123
    2 minutes 3 seconds

### Options

    -a     prints all number even they are zeros.
    -p[X]  padding for numbers. 'X' is the padding character, default is ' '.
    -P     padding for unit strings.

 * `-a` will prints all numbers and units even the numbers are zeros.
 * `-p` prints out like ` 1 second` or `-p0` for `01 second` or `07 seconds`.
 * `-P` prints out like `1 minute  12 seconds`, note there is additional space after `minute`.

License
-------

This project is licensed under the MIT License.

    Copyright (c) 2010, 2012 Yu-Jie Lin

td.sh
=====

Converting seconds to human readable time duration.

Usage
-----

The basic usage:

    $ ./td.sh 123
    2 minutes 3 seconds

You can source the script to have `print_td` function for better performance:

    $ source td.sh
    $ print_td 123
    2 minutes 3 seconds
    $ ./td.sh 1 2 60 61
    1 second
    2 seconds
    1 minute
    1 minute 1 second
    $ ./td.sh -p -P 1 2 60 61
     1 second 
     2 seconds
     1 minute 
     1 minute   1 second 
    $ ./td.sh -p -P -a 1 2 60 61
     0 days  0 hours  0 minutes  1 second 
     0 days  0 hours  0 minutes  2 seconds
     0 days  0 hours  1 minute   0 seconds
     0 days  0 hours  1 minute   1 second 

### Options

    -a     prints all number even they are zeros.
    -p[X]  padding for numbers. 'X' is the padding character, default is ' '.
    -P     padding for unit strings.

 * `-a` will prints all numbers and units even the numbers are zeros.
 * `-p` prints out like ` 1 second` or `-p0` for `01 second` or `07 seconds`.
 * `-P` prints out like `1 minute  12 seconds`, note there is additional space after `minute`.

Tests
-----

There is a script named `td-test.sh` for testing.

Links
-----

 * [Author][]'s posts:
   * [Printing human readable time duration using Bash](http://blog.yjl.im/2010/11/printing-human-readable-time-duration.html)
   * [Updating td.sh, Bash time duration library](http://blog.yjl.im/2012/01/updating-tdsh-bash-time-duration.html)

[Author]: http://blog.yjl.im

License
-------

This project is licensed under the MIT License.

    Copyright (c) 2010, 2012 Yu-Jie Lin

Add Tests and Links sections
Add Tests and Links sections
