[olug] Uptime to boot date
David Walker
linux_user at grax.com
Tue Oct 29 19:41:11 UTC 2002
Also, the creation date of the /proc directory will be the reboot date of your
machine.
On Tuesday 29 October 2002 01:26 pm, (Via 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