In English, we don't put "the" before exact times of the day, like midnight or 3pm (unless, as HarvardF writes, the time is used as a modifier, such as "the 3pm meeting"). We do put "the" (or "a") before spans of time, such as "the morning," "the week," and "the year" (unless one is being more specific and saying "every year," "each week," or "that morning").
It might be a bit weird, but you can't put "the" before midnight in English, even though you can put it before afternoon. "He came in the afternoon" is correct, and "We kissed at midnight" is correct, just to give you two examples.
The only situation where you can put "the" before midnight, is when midnight works as a adjective. "I wait for the midnight bus" is correct since you're actually talking about "the (midnight) bus".