# Use the function from the previous reply # to read the value from /proc/uptime my $uptime = uptime(); my @tm = gmtime($uptime); my $string = sprintf("%03d %02d:%02d:%02d", $tm[7], $tm[2], $tm[1], $tm[0]);