When a player sleeps in a bed, the date will skip ahead by 1, and the time will be set to 0600am of that day. This can be done at any time during the day, not just at night. At this point in time, the player will receive any money from items they have shipped using the Shipping box. A player's hunger will also reset to full with 1/4 saturation.
In multiplayer, if there is only one player online, the hunger will reset like normal. If there are multiple users online, hunger will not be reset.