From f5de9d301ca5dbc620f35d4009eb170d85fe93c9 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 5 Dec 2010 00:06:43 +0000 Subject: RTx-Statistics in 2.1 / 3.8 --- rt/share/html/RTx/Statistics/DurationAsString | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 rt/share/html/RTx/Statistics/DurationAsString (limited to 'rt/share/html/RTx/Statistics/DurationAsString') diff --git a/rt/share/html/RTx/Statistics/DurationAsString b/rt/share/html/RTx/Statistics/DurationAsString new file mode 100755 index 000000000..c0b4d9af4 --- /dev/null +++ b/rt/share/html/RTx/Statistics/DurationAsString @@ -0,0 +1,18 @@ +<%$days|'00'%> days <%$hours|'00'%>:<%$minutes|'00'%> +<%INIT> + +my $MINUTE = 60; +my $HOUR = $MINUTE*60; +my $DAY = $HOUR * 24; +my $WEEK = $DAY * 7; +my $days = int($Duration / $DAY); +$Duration = $Duration % $DAY; +my $hours = int($Duration / $HOUR); +$hours = sprintf("%02d", $hours); +$Duration = $Duration % $HOUR; +my $minutes = int($Duration/$MINUTE); +$minutes = sprintf("%02d", $minutes); + +<%ARGS> +$Duration => undef + -- cgit v1.2.1