DST. Some countries (Brazil) switch over at midnight instead of 2:00 am. One day of the year has no midnight.
I never considered how many logical problems arise from the use of AM/PM. I knew time handling is tricky but it seems like every time I see this topic discussed, I learn about a new corner case.
Some cultures end the day at (wait for it...) sunset.
And now we're back to the original problem.
Apparently Muslims and Jews here have agreed that the day ends at sunset or at 21:00, whichever comes first (or at all). It would be difficult if you couldn't eat for the better part of a month.