If you switch to Spectator mode while sleeping (only possible with /gamemode spectator command), the night never skips.
The night would skip or you would be kicked out of bed