Question / Feature request regarding localized time format
See original GitHub issueThis may be possible, but I couldn’t find it in the docs. I would like to display a time in a users locally preferred format—either 24h or 12h with am/pm. I tried localizedFormat with ‘LT’, but that gives me 1:36 PM in the UK, where the preferred time format is 24h (as returned by new Date().toLocaleString().
Is there a way to show a time either as HH:mm or h:mm a depending on the user’s locale / machine preferences?
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Date time formats and export feature request (potential bug)
I am comparing activity outside working hours from the para data with the exported time stamps (I converted paradata from UTS to local...
Read more >Localize time format in Calendar widget - Mendix Forum
The Calendar widget is based on the (JS) Full Calendar. The documentation mentions, and the code clearly shows, the usage of Locale to...
Read more >java - SimpleDateFormat and locale based format string
The java. time classes use ISO 8601 formats by default for parsing/generating strings.
Read more >Supported Date and Time Formats (ICU) - Salesforce Help
We use three variations of date and time formats across the Salesforce application: short, medium, and long. All three formats are listed for...
Read more >Date - JavaScript - MDN Web Docs - Mozilla
Chrome Edge
Date Full support. Chrome1. Toggle history Full support. Edge12. Toggle hist...
@@toPrimitive Full support. Chrome47. Toggle history Full support. Edge15. Toggle hist...
Date() constructor...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

For what it’s worth, in my use case, using native JS Date objects rather than dayjs is probably the right answer:
gives exactly the output I’m after in all locales tested so far.
Another plugin? I must admit I had thought that’s exactly what LocalizedFormat was supposed to do…