[phpBB Debug] PHP Notice: in file /viewtopic.php on line 981: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 981: getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
Tynsoe Projects • View topic - Simple command out of my mind to dissect uptime

Simple command out of my mind to dissect uptime

Simple command out of my mind to dissect uptime

Postby ybizeul » Fri Dec 31, 2010 5:31 pm

Code: Select all
SECS=$(( `date +%s` - `sysctl kern.boottime|sed -e "s/.*sec = \([0-9]*\),.*/\1/"` ))

DAYS=$(( $SECS / (3600 * 24) ))

SECS=$(( $SECS - ((3600 * 24) * $DAYS) ))

HOURS=$(( $SECS / 3600 ))

SECS=$(( $SECS - (3600 * $HOURS) ))

MINUTES=$(( $SECS / 60 ))

SECS=$(( $SECS - ($MINUTES * 60) ))

echo $DAYS jours, $HOURS heures $MINUTES minutes $SECS secondes
ybizeul
Site Admin
 
Posts: 133
Joined: Fri Jan 22, 2010 4:34 pm

Return to GeekTool

Who is online

Users browsing this forum: No registered users and 1 guest

cron