Well, if you run this Javascript:
Intl.DateTimeFormat([],{"timeStyle":"medium"}).format(new Date())
It should return the current time, formatted according to your locale and user preferences.
By contrast, this should return it formatted with the defaults for your locale, ignoring your user preferences:
Intl.DateTimeFormat(navigator.language,{"timeStyle":"medium"}).format(new Date())
For me, the first returns 24 hour time and the second returns 12 hour time. Because 12 hour time is default for my primary locale (en-AU), but I override it to 24 hour time in my macOS settings.
I know the same works on Windows, and I’m sure it works on Linux too, just the way you configure it is different for each OS.