What to do if my advisor insists on early attendance? I have a genuine problem in waking up early in the morning. My advisor prefers to walk in my office whenever he wanted to. Lately, he started to complain to me about not showing up in the morning. Even the way to
 he used to come to my office has changed, he started to open the door without knocking and then the first thing he checks my computer screen.

I tried to tell him that about my difficulties and suggested scheduling meetings instead. He told me these are the rules of the institution and I have to follow them.

Long story short, I started to come early in the morning but I can barely get anything done.



Update 1: I reviewed the contract, it explicitly mentioned that working time starts no later than 9am. My contract is with an institution not the university directly.

Update 2 : I consulted a doctor and I have been diagnosed with depression. Besides the medication that was prescribed to me, I was asked to take a rest from the school.
Thank you, everyone, for sharing your thoughts.
As a fellow night owl, I feel your pain. Normally I would suggest concisely explaining your difficulties and suggesting a work-around to your advisor, but it sounds like you've already done that. Sadly, your advisor does have the right to set working hours, so you have no real recourse other than finding a different advisor. 

The situation might be different if you have a medical diagnosis/disability -- but I don't think "night owl" will qualify, since waking up early is not harmful to your health (not sure about French law though). What I've done in similar situations is to use melatonin to fall asleep early and caffeine pills to wake up -- probably not the healthiest solution long-term, but it does the trick for me.