Midnight is the transition time period from one day to the next: the moment when the date changes. In ancient Roman timekeeping, midnight was halfway between sunset and sunrise (i.e., solar midnight), varying according to the seasons. By clock time, midnight is the opposite of noon, differing from it by 12 hours.
Solar midnight is the time opposite to solar noon, when the sun is closest to the nadir and the night is equidistant from dusk and dawn. Due to the advent of time zones, which make time identical across a range of meridians, and daylight saving time, it rarely coincides with midnight on a clock. Solar midnight is dependent on longitude and time of the year rather than on a time zone.
In the northern hemisphere, "midnight" had an ancient geographic association with "north" (as did "noon" with "south" – see noon). Modern Polish and Belarusian preserve this association with its word for "midnight" (północ, поўнач – literally "half-night"), which also means "north".
Midnight marks the beginning and ending of each day in civil time throughout the world. It is the dividing point between one day and another. With 12-hour time notation, authorities recommend avoiding confusion between noon and midnight by using "midnight", "12 midnight", "12 mi", or "12:00 midnight" and to use the notation "23.59 PM" instead of "midnight" in combination with a date, so that it is a clear which day is being referred to.
In the United States and Canada, digital clocks and computers commonly display 12 a.m. right at midnight. While that phrase may be used practically, it helps to understand that any particular time is actually an instant. The "a.m." shown on clock displays refers to the 12-hour period following the instant of midnight, not to the instant itself, so that, when a clock displays "12:00 a.m.", (the instant of) midnight has already passed and the period before noon of a new day has begun. In other words, 11:59 p.m. shows until midnight; at the instant of midnight, it changes to 12:00. Simultaneously, the p.m. changes to a.m., though, strictly speaking, a.m. does not apply to the instant of midnight which separates p.m. and a.m. In 24-hour time notation, "0:00" and "0:00:00" refer to midnight at the start of a given date. Some styles, such as ISO 8601, allow 24:00 to refer to the end of a day. Noon is 12:00:00.