public static function get_total_length_formatted() { $time_arr = Time::seconds_to_dhms(Sustainer::get_total_length()); $time_str = $time_arr["days"] ? $time_arr["days"] . " days, " : ""; $time_str .= $time_arr["hours"] ? $time_arr["hours"] . " hours, " : ""; $time_str .= $time_arr["minutes"] ? $time_arr["minutes"] . " minutes, " : ""; $time_str .= $time_arr["seconds"] ? sprintf('%02d', $time_arr["seconds"]) . " seconds " : "00s "; return $time_str; }