How long has my Mac been on?
If you’re wondering how long your Mac has been turned on and running for, simply launch the Terminal and type the following command into the command line:
uptime
This command will report back your system uptime, telling you how long your Mac has been turned on. You will see something like the following:
10:17 up 10 days, 11:02, 4 users, load averages: 0.34 0.29 0.24
As you can see, this Mac has been running for 10 days and 11 hours and 2 minutes.

16:04 up 37 days, 4:59, 23 users, load averages: 0.38 0.33 0.31
37 days???? what?? i have 4 days and i think thats good
There is a way to find out when it was shut down and turned on. It comes up with a list of a bunch of times, not just one.
You can find out the uptime thru System Profiler -> Software -> Time since boot.
Use istat pro widget. It tells gives you uptime and much more.
This is a regular Unix command works in Mac and in any other Unix/Linux outthere.
23Days 21:05
[...] using the “last reboot” command instead. Similarly if you’re only looking to see how long a Mac has been powered on, you can use the simple “uptime” command, which will give you [...]