util::interval_pretty (public)

 util::interval_pretty [ -seconds seconds ]

Defined in packages/acs-tcl/tcl/utilities-procs.tcl

Takes a number of seconds and returns a pretty interval of the form "3h 49m 13s"

Switches:
-seconds (optional, defaults to "0")

Partial Call Graph (max 5 caller/called nodes):
%3 test_util__interval_pretty util__interval_pretty (test acs-tcl) util::interval_pretty util::interval_pretty test_util__interval_pretty->util::interval_pretty aa_test::parse_install_file aa_test::parse_install_file (public) aa_test::parse_install_file->util::interval_pretty packages/acs-admin/www/auth/authority.tcl packages/acs-admin/ www/auth/authority.tcl packages/acs-admin/www/auth/authority.tcl->util::interval_pretty

Testcases:
util__interval_pretty
Source code:
    set result {}
    if { $seconds > 0 } {
        set hrs [expr {$seconds / (60*60)}]
        set mins [expr {($seconds / 60) % 60}]
        set secs [expr {$seconds % 60}]
        if { $hrs > 0 } { append result "${hrs}h " }
        if { $hrs > 0 || $mins > 0 } { append result "${mins}m " }
        append result "${secs}s"
    }
    return $result
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/utilities-procs.xql

[ hide source ]
Show another procedure: