]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
connections.cgi: Use &General::format_time()
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 27 Apr 2024 11:59:03 +0000 (13:59 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 7 Aug 2024 12:28:19 +0000 (14:28 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/connections.cgi

index 4bd4c6057c8e5d3d3ddbea0b1529f8199dd4b478..69d89f51ce94cafc6b6e46a0aaca68ac22bb3689 100644 (file)
@@ -484,7 +484,7 @@ foreach my $line (<CONNTRACK>) {
        my $dst_flag_icon = &Location::Functions::get_flag_icon($dstccode);
 
        # Format TTL
-       $ttl = format_time($ttl);
+       $ttl = &General::format_time($ttl);
 
        my $sip_extra;
        if ($sip_ret && $sip ne $sip_ret) {
@@ -582,21 +582,6 @@ print "</table>";
 &Header::closebigbox();
 &Header::closepage();
 
-sub format_time($) {
-       my $time = shift;
-
-       my $seconds = $time % 60;
-       my $minutes = $time / 60;
-
-       my $hours = 0;
-       if ($minutes >= 60) {
-               $hours = $minutes / 60;
-               $minutes %= 60;
-       }
-
-       return sprintf("%3d:%02d:%02d", $hours, $minutes, $seconds);
-}
-
 sub ipcolour($) {
        my $id = 0;
        my $colour = ${Header::colourred};