macbook Random reboot and forgot the time
Time to swing the voodoo chicken.

Things to try, in increasing order of intrusiveness:

1) PRAM reset: Reboot machine, holding Command+Option+P+R. Machine will begin to boot, and then automatically reboot itself. Let this cycle continue for 2-3 reboots, then let go and let the machine boot normally. Yeah, I know.

2) SMC reset (the more likely one): http://support.apple.com/kb/HT3964

It's entirely possible that the SMC itself is malfunctioning, which would require a logic board replacement. From your description, I think it's unlikely that this is a software-related issue.