perl -we 'use Date::Manip::Date; my $pid = shift; my $sstart = readpipe("TZ=UTC ps --no-headers --format lstart --pid " . (0+$pid)); my $start = Date::Manip::Date->new($sstart, [SetDate => "zone,UTC"]); my $estart = $start->printf("%s"); print "process $pid started at epoch time $estart\n";' 1967 #### perl -we 'use POSIX(); my $pid = shift; my $seconds_since_boot; { open my $UPTIME, "<", "/proc/uptime" or die; <$UPTIME> =~ /(\S+)/ or die; $seconds_since_boot = 0+$1; } my $start_time; { open my $STAT, "<", "/proc/" . (0+$pid) . "/stat" or die; <$STAT> =~ /\)(.+)/ or die; $start_time = 0+(split " ", $1)[19]; } my $Hertz = POSIX::sysconf(POSIX::_SC_CLK_TCK()); my $start_epoch = time() - $seconds_since_boot + $start_time / $Hertz; print "process $pid started at epoch time $start_epoch\n"' 1967