It depends whether you interpret "23:59:59" as being an instant (1 second before the end of most days) or a duration (the last second of most days).
23:59:59.500 is after 23:59:59 when interpreted as an instant, but it is part of 23:59:59 as a duration.