Not getting enough sleep can do more than make you cranky. New research suggests it’s not just the amount of sleep, but when you go to bed that morphs you into a real life Eeyore. A study published in the journal Cognitive Therapy and Research found that people who hit the sack very late at night and snooze for shorter periods of time have more negative thoughts than those who get the recommended dose of Zs. Study authors Jacob Nota and Meredith Coles of Binghamton University replicated past studies that linked sleep problems to negative thoughts, then set out to find a link between this pesky side effect and the actual time someone goes to bed. They learned that students who slept for shorter periods of time and went to bed later experienced more negative thoughts than those who kept regular sleep hours. This was especially the case for students who considered themselves night owls. And it’s not just about sleep quantity, but quality. Your eight hours of sleep should be as aligned as possible with the light-dark and social clock.

READ MORE: Science Explains the Ideal Bedtime