system - Retrieving Last Boot Time Stamp In C -


i've been able retrieve uptime value proc/uptime (which in seconds). however, need retrieve last boot time stamp using c. (i cannot use system() function call uptime).

for example, correct time need is, when run "uptime", value is:

15:31:35 2 days,  4:14,  3 users,  load average: 0.04, 0.05, 0.05 

i need first part: 15:31:35. there built in c function can me this? appreciated!

open /proc/uptime , read it. first number uptime in seconds.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -