The short answer
The Islamic date changes when the sun sets. After maghrib, the new date has begun, even though the daytime of that date will only come after the night.
There are two separate points, and keeping them apart removes most confusion:
- The calendar date changes at sunset. This is why people speak of "the night of Friday", which is the night before the day of Friday.
- The day of worship, such as the fast, runs from true dawn (fajr) to sunset. The night after sunset belongs to the date that has just begun.
This is the way scholars commonly explain the lunar calendar. Some civil calendars and phone apps switch the date at midnight, because that suits ordinary daily life, so the date shown in the evening can differ from the Islamic date.



