I would like to change the time format to 24 hours (from 3:00 PM to 15:00). To what do I need to change the current, h:mma
and h:mm a
? Thanks!
Answering my own question. It seems Discourse uses Moment.js format string. In the case of my request, it is simply a matter of changing h:mma
and hmm a
to HH:mm
. More references on the Moment.js format page.
I hope I did not break things!
Hi! I didn’t realize how to do it in Discourse. What exactly did you do to change time format to 24 hours?
Go to Settings → Customize → Text
And then search for :mm
and then change the format according to what you want with the Moment.js format page as a guide.
However, it doesn’t fully work. In Chat the timestamps went from the AM/PM style to a 24 hour clock, but not everything for some reason. Also did a rebuild and tried with another browser without anything cached.
I modified the following:
Of course changing the locale to a European country (excluding the UK) would do the trick as well. But then the site’s language changes too. To keep custom text and language consistent, I’ve locked it to US English. It’s just the time format I want to change. Maybe the date format later as well.
Does anyone know how to fix those last few inconsistencies in terms of the time format? I want everything in a 24 hour time format, while using US English. My guess is that those outliers don’t use these variables but are hardcoded to that format.
Actually changing country doesn’t change time to 24h on chat. But well, chat isn’t ready yet. But that is because of lack of translations, I reckon.
This topic was automatically closed after 2682 days. New replies are no longer allowed.