Re: [tkined] TimeTicks format

From: George Ross (gdmr@dcs.ed.ac.uk)
Date: Tue Jul 03 2001 - 14:58:21 MET DST


> But when you use this value for display , it's not very nice....

How about [clock format ...]? For example:

   set vb "SNMPv2-MIB!sysUpTime.0"
   set vb [$snmpS get $vb]
   set v [snmp value $vb]
   # Divide by 100 by chopping the last two digits off the end of
   # the timeticks value...
   set snmpUpTime [string range $v 0 [expr [string length $v] - 3]]
   set bootTime [expr [clock seconds] - $snmpUpTime]
   puts "Up since [clock format $bootTime]"

-- 
Dr George D M Ross, Division of Informatics, University of Edinburgh
     Kings Buildings, Mayfield Road, Edinburgh, Scotland, EH9 3JZ
Mail: gdmr@dcs.ed.ac.uk   Voice: +44 131 650 5147   Fax: +44 131 667 7209
PGP DSA: 1024/AD758CC5 B91E D430 1E0D 5883 EF6A  426C B676 5C2B AD75 8CC5


--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.



This archive was generated by hypermail 2b29 : Thu Jan 03 2002 - 14:56:27 MET