Seems it uses /proc/stat to calculate boot time.
From ps src:
./ps/display.c
-------------------------------------
int main(int argc, char *argv[]){
...
reset_global();
...
}
-------------------------------------
./ps/global.c
-------------------------------------
void reset_global(void){
...
/* get boot time from /proc/stat */
fd = open("/proc/stat", O_RDONLY, 0);
if (fd != -1) {
buf[BUFFSIZE-1] = 0;
read(fd, buf, BUFFSIZE-1);
b = strstr(buf, "btime ");
if (b) {
sscanf(b, "btime %lu", &time_of_boot);
seconds_since_boot = time(0) - time_of_boot;
}
close(fd);
}
...
}
-------------------------------------
./ps/output.c
-------------------------------------
static int pr_stime(char *restrict const outbuf, const proc_t *restrict const pp){
...
t = time_of_boot + pp->start_time / Hertz;
...
}
-------------------------------------