文件

建立、使用和掌握Discord時間相關功能的綜合指南。

什麼是Discord時間戳?

了解對每個人都有效的時間背後的魔力。

Discord時間戳是一種特殊標記,允許您顯示自動轉換為每個使用者本地時區的日期和時間。當您貼上時間戳程式碼時,Discord會讀取它並顯示為檢視者調整的時間,使其完美適用於全球協調。

時間戳語法

如何建構時間戳程式碼。

Discord時間戳的基本語法是:

<t:1640995200:f>

其中:

  • 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

Unix Timestamp = (Current Date/Time - January 1, 1970 00:00:00 UTC) / 1000

Result is in milliseconds, divide by 1000 to get seconds

Example Conversion

Real-world example of timestamp conversion:

Date: December 31, 2023 23:59:59 UTC
Unix: 1704067199
Discord: <t:1704067199:F>

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.

FormatDiscord CodeExample OutputBest Use Case
t
Short Time
<t:1640995200:t>4:20 PMQuick time mentions
T
Long Time
<t:1640995200:T>4:20:00 PMPrecise time specifications
d
Short Date
<t:1640995200:d>12/31/2021Date-only references
D
Long Date
<t:1640995200:D>December 31, 2021Formal announcements
f
Short Date/Time
<t:1640995200:f>December 31, 2021 4:20 PMStandard event times
F
Long Date/Time
<t:1640995200:F>Friday, December 31, 2021 4:20 PMDetailed schedules
R
Relative Time
<t:1640995200:R>3 years agoDeadlines and countdowns

Time Unit Conversion Reference

Essential time unit conversions for working with Unix timestamps and Discord time codes.

Seconds Conversion Table

Time UnitSeconds
1 minute60
1 hour3,600
1 day86,400
1 week604,800
1 month (30 days)2,592,000
1 year (365 days)31,536,000

Quick Reference Examples

Add 1 Hour
timestamp + 3600
Add 1 Day
timestamp + 86400
Add 1 Week
timestamp + 604800
Subtract 1 Day
timestamp - 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.

我們的工具套件

管理全球社群時間所需的一切。

時間戳產生器和工作台

我們的主要工具幫助您輕鬆建立時間戳。整合的「時間戳工作台」是一個獨特功能,讓您一次查看所有可用格式。

  • 使用易於使用的日曆選擇任何日期和時間。
  • 從單個表格中立即預覽和複製任何格式的程式碼。
前往時間戳產生器 →

時區轉換器

跨不同時區規劃活動?我們的轉換器是完美的工具。

  • 在您的本地時區選擇日期和時間。
  • 選擇目標時區以查看朋友的確切對應時間。
前往時區轉換器 →