It sounds like you are confusing 12:00 PM (noon) with 12:00 am (midnight). 17:00 is 7 hours away from midnight (12:00 AM or 24:00 (today) or 00:00 (tomorrow)).
In the 24-hour time notation, the day begins at midnight, 00:00, and
the last minute of the day begins at 23:59. Where convenient, the
notation 24:00 may also be used to refer to midnight at the end of a
given date[5] – that is, 24:00 of one day is the same time as 00:00 of
the following day.