Questioning the Conversion of Time from 00:30 to 24:30 in en-US Locale
options = {
year: "numeric",
day: "numeric",
month: "numeric",
hour: '2-digit',
minute: '2-digit',
hour12: false
}
let actualDate = value;
if (typeof value == "string") { actualDate = new Date(value); }
//even when using this code, it still displays 24:30 for 00:30
var time = actualDate.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', hour12: false});
//the same issue occurs with date and time where 24:30 is converted into 00:30
actualDate.toLocaleDateString('en-US', options);
However, when changing the locale to 'en-GB' (English United Kingdom) the correct time 00:30 for 00:30 is displayed.
var time = actualDate.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', hour12: false});
actualDate.toLocaleDateString('en-US', options);
This inconsistency is causing confusion. The concept of a time like 24:30 (which would be equivalent to 12:30 AM in a 24-hour format) seems peculiar according to English in the United States. Is there any validity to the existence of 24:30 under US English conventions?