[olug] Uptime to boot date

Quinn Coldiron qcoldir at nmhs.org
Tue Oct 29 19:40:20 UTC 2002


Now we need something in Java, C, Python, LISP, Pascal (Free Pascal or
Kylix acceptable).  Anything else?

:-)

Quinn

On Tue, 2002-10-29 at 13:26, David Walker wrote:
> Here is a tcl script
> 
> 
> #!/usr/bin/tclsh
> 
> set proc_uptime [exec cat /proc/uptime]
> set uptime [string range $proc_uptime 0 [string first {.} $proc_uptime]]
> 
> set boot_date [expr int([clock seconds] - $uptime)]
> 
> puts [clock format $boot_date]
> 
> 
> On Tuesday 29 October 2002 11:27 am, (Via wrote:
> > Anyone know a quick way how I can turn the uptime output into an actual
> > date/time of the last boot?  Would it be the date command?
> >
> > [~]$ uptime
> >  11:25am  up 493 days,  2:41
> >
> > Jon L.
> 
> _______________________________________________
> OLUG mailing list
> OLUG at olug.org
> http://lists.olug.org/mailman/listinfo/olug
-- 




More information about the OLUG mailing list