Though some may believe the coldest time of the day is at midnight, or some time before the sun rises, this is generally not true. The coldest part of the day is usually just after the sun rises. However, there are a few times, especially in the winter, when the coldest temperature may not be during this morning time period. Weather patterns can play a role in determining when low temperatures hit during the day.
To fully understand why the coldest time of the day is just after sunrise, it is important to understand how the Earth receives and loses heat. The planet is constantly receiving radiant heat from space and returning it to space. The vast majority of the heat the Earth receives comes from the sun. During the day, heat is gained and during the night it is lost. However, just because it is night at your location does not mean the entire Earth is losing heat. One side is losing heat, but the side facing the sun is gaining heat.
As the sun rises, the portion of the Earth that is just beginning to receive the sun's rays is still in the process of losing heat. As with any property governed by inertia, it takes a little time to reverse this trend. Meteorologist David Cook at the Argonne National Laboratory explains that, "Because the sun is so low to the horizon at sunrise, most of the energy is absorbed by the distant atmosphere."
However, weather changes from day to day and the coldest temperatures may not always be during the time right after dawn. In some cases, a cold front could pass through a location, leading to cold temperatures at any point during the day, if the front is powerful enough. If this happens, the coldest time will likely be in the hours after the front passes through.
Generally speaking, this cold front scenario is very rare. It may only happen a few times a year at many locations. At lower latitudes, it may never happen. It is safe to say that, in most cases, the coldest time of the day is usually just after the dawn.