This function will help you to calculate the time a person spent in bed based on their sleep log. This type of calculation is very common in sleep research. However, as one can guess, working with dates in R is a bit tricky. This function will ease the task. More importantly you do not require to entry the dates to calculate bed time. Just wake up time and time to go to bed is enough (24 hour format).