There are various ways to get the uptime.
1.) Print the process list (ps), then grep for the name of the webserver, then grep for the root user cause this one holds the initial programm the rest are childs per request (depending on MPM)
Code:
ps aux | grep httpd | grep root
2.) Print the first line of the access log and extract the time. This holds only true if you use the apache logging itself. Else you have to find the log file that contains the startup message