文件
建立、使用和掌握Discord時間相關功能的綜合指南。
什麼是Discord時間戳?
了解對每個人都有效的時間背後的魔力。
Discord時間戳是一種特殊標記,允許您顯示自動轉換為每個使用者本地時區的日期和時間。當您貼上時間戳程式碼時,Discord會讀取它並顯示為檢視者調整的時間,使其完美適用於全球協調。
時間戳語法
如何建構時間戳程式碼。
Discord時間戳的基本語法是:
其中:
- 1640995200 是特定的時刻,以自1970年1月1日以來的秒數(Unix紀元)計算。
- f 是定義時間戳應如何顯示的可選字母。
格式選項
t - 短時間
例如:上午10:20
用法:<t:1640995200:t>T - 長時間
例如:上午10:20:30
用法:<t:1640995200:T>d - 短日期
例如:2021/04/20
用法:<t:1640995200:d>D - 長日期
例如:2021年4月20日
用法:<t:1640995200:D>f - 短日期/時間
例如:2021年4月20日 上午10:20
用法:<t:1640995200:f>F - 長日期/時間
例如:2021年4月20日星期二 上午10:20
用法:<t:1640995200:F>R - 相對時間
例如:2年前
用法:<t:1640995200:R>Understanding Unix Timestamps
Learn how Unix timestamps work and how they power Discord's time system.
The Unix Timestamp Formula
Result is in milliseconds, divide by 1000 to get seconds
Example Conversion
Real-world example of timestamp conversion:
How to Calculate
Manual calculation steps:
- Get current date/time in UTC
- Calculate seconds since Jan 1, 1970
- Use in Discord format: <t:TIMESTAMP:FORMAT>
Discord Format Code Reference
Complete reference table for all Discord timestamp format codes with examples and use cases.
| Format | Discord Code | Example Output | Best Use Case |
|---|---|---|---|
tShort Time | <t:1640995200:t> | 4:20 PM | Quick time mentions |
TLong Time | <t:1640995200:T> | 4:20:00 PM | Precise time specifications |
dShort Date | <t:1640995200:d> | 12/31/2021 | Date-only references |
DLong Date | <t:1640995200:D> | December 31, 2021 | Formal announcements |
fShort Date/Time | <t:1640995200:f> | December 31, 2021 4:20 PM | Standard event times |
FLong Date/Time | <t:1640995200:F> | Friday, December 31, 2021 4:20 PM | Detailed schedules |
RRelative Time | <t:1640995200:R> | 3 years ago | Deadlines and countdowns |
Time Unit Conversion Reference
Essential time unit conversions for working with Unix timestamps and Discord time codes.
Seconds Conversion Table
| Time Unit | Seconds |
|---|---|
| 1 minute | 60 |
| 1 hour | 3,600 |
| 1 day | 86,400 |
| 1 week | 604,800 |
| 1 month (30 days) | 2,592,000 |
| 1 year (365 days) | 31,536,000 |
Quick Reference Examples
timestamp + 3600timestamp + 86400timestamp + 604800timestamp - 86400💡Pro Tip
When working with timestamps, always perform calculations in seconds, then convert to your desired format. This prevents floating-point errors and ensures accuracy.
我們的工具套件
管理全球社群時間所需的一切。
時間戳產生器和工作台
我們的主要工具幫助您輕鬆建立時間戳。整合的「時間戳工作台」是一個獨特功能,讓您一次查看所有可用格式。
- 使用易於使用的日曆選擇任何日期和時間。
- 從單個表格中立即預覽和複製任何格式的程式碼。