# 日期应显示时间而非“今天”，适用于时间格式

**URL:** https://meta.discourse.org/t/date-should-show-the-time-instead-of-today-for-time-formats/151435
**Category:** Support
**Created:** [2020年五月14日 05:12 UTC](https://meta.discourse.org/t/date-should-show-the-time-instead-of-today-for-time-formats/151435 "2020-05-14T05:12:23Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jessicah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jessicah/32/102653_2.png) [@jessicah](https://meta.discourse.org/u/jessicah)
#### Post date: [2020年五月14日 05:12 UTC](https://meta.discourse.org/t/date-should-show-the-time-instead-of-today-for-time-formats/151435/1 "2020-05-14T05:12:23Z")

</div>

当使用特定时间格式（如“LT”或“LTS”）输入日期时，Discourse 应显示本地时间，而不是字符串“今天”；或者显示“今天”加上本地时间。

例如，12:00 PM 当前渲染为 ![image](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/9/7/972601235719d0c44043eac5c5ae7e86e211fee4.png)

---

<div class="post-metadata">

### Author: ![jessicah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jessicah/32/102653_2.png) [@jessicah](https://meta.discourse.org/u/jessicah)
#### Post date: [2020年五月14日 05:13 UTC](https://meta.discourse.org/t/date-should-show-the-time-instead-of-today-for-time-formats/151435/2 "2020-05-14T05:13:40Z")

</div>

有趣的是，这个实例似乎没有保留时间部分，但在我的安装中却保留了……

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/c/5ced66c64db8820d081c53c084be42c0ac25a97a.png)。我在括号中添加了 UTC 时间，因为否则用户体验不够直观。

---

<div class="post-metadata">

### Author: ![jessicah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jessicah/32/102653_2.png) [@jessicah](https://meta.discourse.org/u/jessicah)
#### Post date: [2020年五月17日 10:10 UTC](https://meta.discourse.org/t/date-should-show-the-time-instead-of-today-for-time-formats/151435/3 "2020-05-17T10:10:02Z")

</div>

啊，我明白了，我的安装版本与此版本之间的差异似乎是 datetime 插件的一个回归问题。之前，字符串 `date=2020-05-14T19:31` 会解析时间部分，而现在需要将其分离，使用单独的 `time` 字段。

不过值得高兴的是，最新版本现在可以显示时间了，所以这部分问题似乎已经修复。

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [2020年五月17日 10:50 UTC](https://meta.discourse.org/t/date-should-show-the-time-instead-of-today-for-time-formats/151435/4 "2020-05-17T10:50:37Z")

</div>

它从未支持将时间作为日期的一部分，尽管可能曾能运行，但这从来不是预期的使用方式。此外，您可以强制显示特定时区。

`[date=2020-05-17 time=12:51:00 displayedTimezone="UTC" timezone="Europe/Paris"]`

2020-05-17T10:51:00Z

---

<div class="post-metadata">

### Author: ![jessicah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jessicah/32/102653_2.png) [@jessicah](https://meta.discourse.org/u/jessicah)
#### Post date: [2020年五月17日 11:24 UTC](https://meta.discourse.org/t/date-should-show-the-time-instead-of-today-for-time-formats/151435/5 "2020-05-17T11:24:53Z")

</div>

啊，好吧，它之前确实是这样工作的，因为升级后我突然发现有些帖子不再正确显示时间了。我下次会记得指定 `time` 的 🙂 另外，谢谢你的更新！这对用户体验来说是一个很大的改进 😃

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [2020年五月18日 09:48 UTC](https://meta.discourse.org/t/date-should-show-the-time-instead-of-today-for-time-formats/151435/6 "2020-05-18T09:48:53Z")

</div>


