Time format to 24 hours

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!

1 Like

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! :slight_smile:

5 Likes

Hi! I didn’t realize how to do it in Discourse. What exactly did you do to change time format to 24 hours?

2 Likes

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.

Screenshot 2022-08-26 at 10-49-50 Pioneering the path to circularity - Train of thought _ Blogs - TZM Community Forum


Screenshot 2022-08-26 at 10-48-15 TZM Community Forum - The Zeitgeist Movement Community Forum

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.

1 Like

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.