For every OS of the planet? Are you kidding? Every OS has its own method. Beside that, the information you want to know is not written on disk, but in RAM, so it's not even searchable.
I can give you some hints for Linux, which I know: craft a uptime program on your own, which spits out a fixed line. Find the uptime command on filesystem (it should stay on /usr/bin/uptime), rename it in uptime.old and put the fake in its place. Every time the user type 'uptime' your program will be used.
Solaris and MacOSX should work more or less the same way. Windows it's a mistery.