Code:
raw 317:*:{ 
  set %idlesecs $asctime($3, s)
  set %idlemins $asctime($3, n)
  set %idlehors  $gettok($calc($3 / 60 / 60 ),1, 46) 
  if ($len(%idlehors) == 3) { set %idlehors $gettok($calc(%idlehors / 60), 1,46) }
  set %idledays $gettok($calc($3 / 60 / 60 / 24),1, 46) 
  set %connecttotal $calc( $gmt - $4 )
  set %connectdays $gettok($calc( %connecttotal / 60 / 60 / 24 ), 1, 46)
  set %connecthors $gettok($calc( %connecttotal / 60 / 60 ), 1, 46)
  if ($len(%connecthors) == 3) { set %connecthors $gettok($calc(%connecthors / 60), 1,46) }
  set %connectmins $asctime(%connecttotal, n)
  set %connectsecs $asctime(%connecttotal, s)
  if ((%idlesecs >= 0) && (%idlemins == 0) && (%idlehors == 0) && (%idledays == 0)) { echo $active  $+ $color(whois text) $+ $timestamp $2 has been idle %idlesecs $+ secs, Signed On $asctime($4,ddd mmm dd HH:nn:ss) }
  if ((%idlesecs >= 0) && (%idlemins >= 1) && (%idlehors == 0) && (%idledays == 0)) { echo $active  $+ $color(whois text) $+ $timestamp $2 has been idle %idlemins $+ mins %idlesecs $+ secs, Signed On $asctime($4,ddd mmm dd HH:nn:ss) }
  if ((%idlesecs >= 0) && ((%idlemins >= 1) || (%idlemins == 0)) && (%idlehors >= 1) && (%idledays == 0)) { echo $active  $+ $color(whois text) $+ $timestamp $2 has been idle %idlehors $+ hours %idlemins $+ mins %idlesecs $+ secs, Signed On $asctime($4,ddd mmm dd HH:nn:ss) }
  if ((%idlesecs >= 0) && ((%idlemins >= 1) || (%idlemins == 0)) && ((%idlehors >= 1) || (%idlehors == 0)) && (%idledays >= 1)) { echo $active  $+ $color(whois text) $+ $timestamp $2 has been idle %idledays $+ days %idlehors $+ hours %idlemins $+ mins %idlesecs $+ secs, Signed On $asctime($4,ddd mmm dd HH:nn:ss) } 
  if ((%connectsecs >= 0) && (%connectmins == 0) && (%connecthors == 0) && (%connectdays == 0)) { echo $active  $+ $color(whois text) $+ $timestamp $2 has been connected for %connectsecs $+ secs }
  if ((%connectsecs >= 0) && (%connectmins >= 1) && (%connecthors == 0) && (%connectdays == 0)) { echo $active  $+ $color(whois text) $+ $timestamp $2 has been connected for %connectmins $+ mins %connectsecs $+ secs }
  if ((%connectsecs >= 0) && ((%connectmins >= 1) || (%connectmins == 0)) && (%connecthors >= 1) && (%connectdays == 0)) { echo $active  $+ $color(whois text) $+ $timestamp $2 has been connected for %connecthors $+ hours %connectmins $+ mins %connectsecs $+ secs }
  if ((%connectsecs >= 0) && ((%connectmins >= 1) || (%connectmins == 0)) && ((%connecthors >= 1) || (%connecthors == 0)) && (%connectdays >= 1)) { echo $active  $+ $color(whois text) $+ $timestamp $2 has been connected for %connectdays $+ days %connecthors $+ hours %connectmins $+ mins %connectsecs $+ secs }
}


[13:21] rhesus has been idle 8hours 52mins 30secs, Signed On Sun Aug 21 23:58:43
[13:21] rhesus has been connected for 2days 61hours 23mins 5secs

the code above is returning " wild " times, like 61hours, how can this be stopped?
thanks smile