# 如何将帖子数据从相对数据改为绝对数据

**URL:** <https://meta.discourse.org/t/how-to-change-the-post-data-from-relative-data-to-absolute/365700>\
**Category:** Product Support\
**Created:** [2025 年5 月 12 日 09:33 UTC](https://meta.discourse.org/t/how-to-change-the-post-data-from-relative-data-to-absolute/365700 "2025-05-12T09:33:09Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

作者： ![aksoforever](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aksoforever/32/502615_2.png) [@aksoforever](https://meta.discourse.org/u/aksoforever)\
发布日期： [2025 年5 月 22 日 01:27 UTC](https://meta.discourse.org/t/how-to-change-the-post-data-from-relative-data-to-absolute/365700/15 "2025-05-22T01:27:48Z")

</div>

我目前正在使用降级版的Discourse，并用组件重写前端代码

电子邮件在插件中使用以下内容，我可以从主题组件修改short\_date吗？

```plaintext
after_initialize do
  if SiteSetting.custom_email_date_format_enabled
    module ::EmailHelper
      def short_date(datetime)
        china_time = datetime.in_time_zone("Asia/Shanghai")
        china_time.strftime("%Y-%m-%d %H:%M")
      end
    end
  end
end

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-change-the-post-data-from-relative-data-to-absolute/365700)._
