Why does it have to be an examine area? Why not a normal script area? Are you trying to ask how to have the player sleep for x hours and then wake up with the lights a different color?
If that is the case, then I'll explain what needs to happen. The player could click on the bed where a script area is interactable and then have a fade out effect and then change the lighting or such to whatever time the player will wake up to. Then finally have the player be teleported back into the bed crouched, if the player doesn't get in the bed manually. Finally, have the screen fade back in to normal followed by the normal waking up procedure.
I'm sure you can translate that paragraph into some script, since you could have at least attempted it.