AgentSkillsCN

discord-timestamps

将任意日期、时间或时间戳转换为 Discord 动态时间戳格式。该功能始终同时显示完整时间戳与剩余相对时间,确保每位用户都能准确查看本地时间。

SKILL.md
--- frontmatter
name: discord-timestamps
description: Convert any date, time, or timestamp into Discord dynamic timestamp format. Always renders both the full timestamp and relative time remaining so every user sees correct local time.

Discord Timestamps

Convert any date, time, or timestamp into Discord's dynamic timestamp format (<t:UNIX:STYLE>). These render natively in Discord, automatically adjusting to each user's local timezone — no more "what timezone is that?" questions.

When to use

Always use Discord timestamps when presenting dates or times in Discord messages. Never output raw dates like "Feb 15, 2026 at 6:00 PM EST" — use the Discord format instead so every user sees the time correctly in their own timezone.

Common triggers:

  • Game session times and schedules
  • Event dates and countdowns
  • Deadlines or reminders
  • Any mention of a specific date/time in a Discord response

How to convert

Run the converter tool via exec:

bash
bash {baseDir}/tools/convert.sh "DATE_STRING"

Input formats accepted

  • ISO 8601: "2026-02-15T18:00:00-05:00"
  • Natural language: "next Thursday at 6pm", "Feb 20 2026 8:00 PM"
  • Relative: "+2 hours", "tomorrow 3pm"
  • Unix timestamp: 1739656800
  • Date only (assumes midnight UTC): "2026-03-01"

Output

The tool returns JSON with the Unix timestamp and all Discord format strings:

json
{
  "unix": 1739656800,
  "full": "<t:1739656800:F>",
  "relative": "<t:1739656800:R>",
  "recommended": "<t:1739656800:F> (<t:1739656800:R>)"
}

Required output format

When displaying a date/time in Discord, always include both:

  1. Full timestamp: <t:UNIX:F> — shows full weekday, date, and time
  2. Relative time: <t:UNIX:R> — shows "in X hours", "2 days ago", etc.

Standard combined format

code
<t:1739656800:F> (<t:1739656800:R>)

This renders in Discord as something like:

Saturday, February 15, 2026 6:00 PM (in 3 days)

The exact display adapts to each user's timezone and locale.

Discord timestamp style reference

StyleCodeExample Output
Short Time<t:UNIX:t>4:20 PM
Long Time<t:UNIX:T>4:20:30 PM
Short Date<t:UNIX:d>02/20/2026
Long Date<t:UNIX:D>February 20, 2026
Short Date/Time<t:UNIX:f>February 20, 2026 4:20 PM
Long Date/Time<t:UNIX:F>Friday, February 20, 2026 4:20 PM
Relative<t:UNIX:R>in 8 days

The bold rows are the two you must always include.

Examples

Game session time

Instead of:

Next session: Thu Feb 15, 2026 at 6:00 PM EST

Use:

Next session: <t:1739656800:F> (<t:1739656800:R>)

Schedule listing

code
**White Tower** — D&D 5e
<t:1739656800:F> (<t:1739656800:R>)
GM: Ken • Free • 4/6 seats

Multiple events

code
📅 **Upcoming Sessions**
• **White Tower** — <t:1739656800:F> (<t:1739656800:R>)
• **Pirate Borg** — <t:1739743200:F> (<t:1739743200:R>)
• **Monster Hunts** — <t:1739829600:F> (<t:1739829600:R>)

Countdown / deadline

code
🎯 Signups close <t:1739570400:F> (<t:1739570400:R>)

Guidelines

  • Always convert dates to Discord timestamps in Discord messages
  • Always include both :F (full) and :R (relative) formats
  • Use the recommended field from the tool output — it has both pre-formatted
  • The tool handles timezone conversion — pass the date string as-is
  • For embed fields where space is tight, you may use just the recommended combined format
  • Discord timestamps are dynamic — relative times auto-update as time passes
  • If you have a raw Unix timestamp already, you can format it directly without the tool: <t:UNIX:F> (<t:UNIX:R>)