In Star Trek Discovery, episode 14, The War Without, The War Within Burnham disturbs Admiral Cornwell at her sleeping quarters, to which Cornwell responds:
I suppose I don't have to tell you it's the middle of the night.
Considering they're aboard a spaceship, how do they determine when is night and day?