# 自动时间戳标题

**URL:** https://meta.discourse.org/t/auto-timestamp-title/408420
**Category:** Theme component
**Created:** [2026年七月24日 07:32 UTC](https://meta.discourse.org/t/auto-timestamp-title/408420 "2026-07-24T07:32:45Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![Andy\_Smith](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andy_smith/32/488094_2.png) [@Andy\_Smith](https://meta.discourse.org/u/Andy_Smith)
#### Post date: [2026年七月24日 07:32 UTC](https://meta.discourse.org/t/auto-timestamp-title/408420/1 "2026-07-24T07:32:45Z")

</div>

| | | |
| --- | --- | --- |
| ℹ | **摘要** | 在编辑器打开的瞬间，自动为新主题的标题填充可配置的时间戳（默认格式为 `YYYY-MM-DD HH:mm:ss`）。 |
| 👓 | **预览** | [Theme Creator](https://discourse.theme-creator.io/theme/Andy_Smith/auto-timestamp-title) |
| 🛠 | **代码库** | [GitHub - andysmith-ai/discourse-auto-timestamp-title · GitHub](https://github.com/andysmith-ai/discourse-auto-timestamp-title) |
| ❓ | **安装指南** | [如何安装主题或主题组件](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682) |
| 📖 | **初次使用 Discourse 主题？** | [Discourse 主题使用入门指南](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) |

安装此主题组件

当编辑器打开时，自动为新主题的标题字段填充时间戳，这样您就无需为快速笔记构思标题。该格式可配置，默认情况下仅对空白标题生效。

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/7/f/c7f90be8c21776207bd196eb5fce7ad8df3a3e03.png)

仅在您开始创建新主题时触发——回复和编辑不受影响。您随后仍可编辑或清除标题。

设置项：

| 设置项 | 默认值 | 描述 |
| --- | --- | --- |
| `title_format` | `YYYY-MM-DD HH:mm:ss` | 生成标题的格式模式。 |
| `overwrite_existing_title` | `false` | 覆盖您已输入的标题。关闭时，仅当标题为空时才插入时间戳。 |
| `use_utc` | `false` | 使用 UTC 时间，而非访客浏览器的本地时间。 |

格式令牌（moment 风格，区分大小写）：`YYYY` `MM` `DD` `HH` `mm` `ss`。其他字符将原样保留——例如 `YYYYMMDDHHmmss` → `20260723153000`。

注意：Discourse 默认的 `min topic title length`（最小主题标题长度）为 15 个字符。上述默认格式长度为 19 个字符，因此可直接使用。如果您选择较短的模式（如 `YYYYMMDDHHmmss`，14 个字符），请相应调低该站点设置，否则单独的时间戳将无法通过验证。

---

_[View the full topic](https://meta.discourse.org/t/auto-timestamp-title/408420)._
