You don’t need the comma when you write it this way.
The comma in June 12, 2024, is there exactly because it’s the wrong order.
It’s basically “I wrote the date. Oops, forgot the year!”
Computers order it correctly in that format because that’s the correct format. In the same way a computer will order any other correctly formatted numbers in the correct order - and incorrectly formatted numbers in the incorrect order - it shouldn’t be surprising that they order correctly formatted dates in the correct order.
You don’t need the comma when you write it this way. The comma in June 12, 2024, is there exactly because it’s the wrong order.
It’s basically “I wrote the date. Oops, forgot the year!”
Computers order it correctly in that format because that’s the correct format. In the same way a computer will order any other correctly formatted numbers in the correct order - and incorrectly formatted numbers in the incorrect order - it shouldn’t be surprising that they order correctly formatted dates in the correct order.
Interesting information.