-
• #2
Looks ok to me, at least for german local:
require("locale").time(new Date());
="07:28:24"
require("locale").time(new Date(), 1);
="07:28"What locale are you using?
-
• #3
I think it looks the same because you're before 1pm?
It does depend on what locale you have and whether you have 12 hour set in your bangle.js settings (under Locale).
But looking at the (default) code at https://github.com/espruino/Espruino/blob/master/libs/js/banglejs/locale.js#L11C2-L12C36
The logic seems to be:
- 12 hour: Everything is 12 hour
- 24 hour: 'short' time is 24 hour, but 'long' time is always 12 hour
But then if you install a language-specific locale, you get:
16:00:04
or similar (just seconds, no meridian) in pretty much all cases: https://github.com/espruino/BangleApps/blob/master/apps/locale/locales.js#L74So I'd be tempted to change the default implementation for the Bangle to work the same way?
- 12 hour: Everything is 12 hour
-
• #4
I noticed this while developing an app and thought it was odd (unless there's a locale for where this actually somehow makes sense). Especially since, as Gordon said, installing a locale seems to make it behave consistently.
Hi all! I'm confused by the disparities between these two date formats. I'm expecting the long format to also be in 24h time. Has anyone else seen this?