Help for this page

Select Code to Download


  1. or download this
    perl -we 'use Date::Manip::Date; my $pid = shift; my $sstart = readpip
    +e("TZ=UTC ps --no-headers --format lstart --pid " . (0+$pid)); my $st
    +art = Date::Manip::Date->new($sstart, [SetDate => "zone,UTC"]); my $e
    +start = $start->printf("%s"); print "process $pid started at epoch ti
    +me $estart\n";' 1967
    
  2. or download this
    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; $st
    +art_time = 0+(split " ", $1)[19]; } my $Hertz = POSIX::sysconf(POSIX:
    +:_SC_CLK_TCK()); my $start_epoch = time() - $seconds_since_boot + $st
    +art_time / $Hertz; print "process $pid started at epoch time $start_e
    +poch\n"' 1967