Hi - I was wondering if someone could help me
I need to calculate a person's sleep duration but since we ask about "usual" sleep times there is no date component
although in my case there are four possibilities
1. THey go to sleep before 12am and wakeup after 12am but before twelve pm (usually me!)
2. They go to sleep after 12am and wake up after 12am but before 12pm
3. They go to sleep after 12am and wakeup after 12pm the same day
4. They go to sleep after 12pm and wakeup before 12am the same day if they were a shift worker for example.
.
Could you help me with formulating the code for calculating this?
I need to calculate a person's sleep duration but since we ask about "usual" sleep times there is no date component
although in my case there are four possibilities
1. THey go to sleep before 12am and wakeup after 12am but before twelve pm (usually me!)
2. They go to sleep after 12am and wake up after 12am but before 12pm
3. They go to sleep after 12am and wakeup after 12pm the same day
4. They go to sleep after 12pm and wakeup before 12am the same day if they were a shift worker for example.
.
Could you help me with formulating the code for calculating this?