The very simple method, I follow is
last shutdown | sed -n 1,1p
last reboot | sed -n 1,1p
execute the above two commands as script. Most of the time it works. ( I have to calculate the hours and minutes, Calculating inside a script is a big headache(!)
Raj.