Using the following terminal command one can retrieve the uptime in seconds:
sysctl kern.boottime
getting a response like this:
kern.boottime: { sec = 1362633455, usec = 0 } Wed Mar 6 21:17:35 2013
Using cut
one can retrieve the amount of seconds:
sysctl -n kern.boottime | cut -c14-18
getting a response like this:
1362633455