The sun and moon rise in the east and set in the west.
When the player creates a new world, the time is set to dawn and the sun starts on the horizon. As time passes, it slowly moves across the sky. As the sun sets, the moon rises. Overall, daytime lasts 10 minutes (in real-time).
Sunlight is the light cast from the sky that burns various undead mobs during daytime. Mobs can shelter from the sunlight by staying underneath any block that does not fully let light through, like glass does, therefore creating a shadow. Clouds can hide the sun, but do not technically block any light and let mobs still burn. During inclement weather, the sky darkens and reduces the amount of light in the world.
Strictly speaking, sunlight can be considered as the presence of both an internal sky light level of at least 12 and a sky light level of 15. Due to this, it is possible to burn undead mobs during rainy weather by covering them with glass.
The sun itself isn't visible when "Beautiful Skies" are turned off, or during precipitation (even in dry biomes in Java Edition). When the camera faces the sun in Bedrock Edition, the environment darkens. Furthermore, in Bedrock Edition, the sun is noticably bigger during sunset, and disappears at night, while it is still visible below the void in Java Edition.
Example of the sun creating shadows and reflections with Vibrant Visuals.
With Vibrant Visuals, the sun is considered a global directional light source, which creates pixelated shadows from blocks, entities, and clouds on all objects. Water bodies exposed to sunlight create bright reflections on the surface, and project water caustics underwater. With denser fog, the sun itself is less illuminated, but creates scattered light rays between blocks, which can illuminate areas not exposed to sky light, such as caves. The color and scattering effects of sunlight are affected by the biome.
Added day/night cycle with the addition of the sun and the moon.
The sun used to rise in the north, not in the east, and it was used to set in the south, not in the west.[1] This was a bug, but was left in the game for quite a while.[2]
If the player is underwater or underground and looks at the sun, it appears the same as the sun at sunset. This is due to the way the sun is rendered when exposed to the sky.
The sun's trajectory forms a perfect vertical circle perpendicular to the ground plane, passing directly through the zenith at noon. This occurs because the rendering logic does not apply any Z-axis rotation or offset to simulate axial tilt or latitude. As a result, the sun does not bias towards the south as it would in the Earth's Northern Hemisphere.