Using CONVERT
for datetime
whose time part is 24 hours - works. Examples with style codes 101-105:
SELECT CONVERT(datetime, '05/24/2023 23:30', 101)
SELECT CONVERT(datetime, '2023.05.24 23:30', 102)
SELECT CONVERT(datetime, '24/05/2023 23:30', 103)
SELECT CONVERT(datetime, '24.05.2023 23:30', 104)
SELECT CONVERT(datetime, '24-05-2023 23:30', 105)
However, I wonder if this behavior is defined, since the documentation doesn't mention the time part:
Style Standard Input/Ouput
101 U.S. 101 = mm/dd/yyyy
102 ANSI 102 = yyyy.mm.dd
103 British/French 103 = dd/mm/yyyy
104 German 104 = dd.mm.yyyy
105 Italian 105 = dd-mm-yyyy
Note that other style codes do mention the time part - so I wonder if using style codes undocumented for 24 hour conversion is a defined behavior, rather than undefined behavior?