TMC 12 o'clock at night [↪ midday]
He's gone for a midnight swim. ! Do not say 'in the midnight'. If you mean 'at 12 o'clock at night' say at midnight and if you mean 'very late at night' say in the middle of the night.
at/on the stroke of midnight (=at exactly midnight)
The treaty will come into force on the stroke of midnight tonight.
The treaty will come into force on the stroke of midnight tonight.
He's gone for a midnight swim.