4 pm is not considered midday and instead 4 pm is considered to be afternoon.
Afternoon is between 12:00 PM "noon" and to around 5:00 PM to 6:00 PM.
Evening is considered from 5:00 PM to 6:00 PM to midnight.
And midday is 12:00 PM or noon.
Both a.m. and p.m. refer to a 12-hour period.
The first 12-hour period lasts from midnight to midday or noon.
That's 12:00 a.m. to 11:59 a.m.
The second 12-hour period lasts from midday to midnight.
So that would be 12:00 p.m. to 11:59 p.m.