时间格式为24小时制

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 个赞

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 个赞

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

2 个赞

转到“设置”–>“自定义”–>“文本”

然后搜索“:mm”,并使用 Moment.js 格式页面 作为指南,根据需要更改格式。

但是,它并不完全起作用。在聊天中,时间戳从上午/下午格式变为 24 小时制,但不知何故并非所有内容都如此。我还进行了重建,并在没有缓存的另一个浏览器中进行了尝试。



我修改了以下内容:

当然,将区域设置为欧洲国家(不包括英国)也可以达到目的。但那样的话,网站的语言也会改变。为了保持自定义文本和语言的一致性,我将其锁定为美式英语。我只想更改时间格式。也许以后日期格式也会更改。

有人知道如何修复时间格式的最后一些不一致之处吗?我想使用美式英语,并将所有内容都设置为 24 小时制。我猜这些异常值没有使用这些变量,而是被硬编码为该格式。

1 个赞

更改国家实际上并不会将聊天时间更改为24小时制。不过,聊天功能尚未准备就绪。但我认为这是因为缺少翻译。

此主题已在 2682 天后自动关闭。不再允许回复。