Entity Info
messageTimestamp
$messageTimestamp
Returns the creation timestamp of the triggering message.
Syntax
$messageTimestamp
$messageTimestamp
The function $messageTimestamp returns the creation timestamp of the triggering message, in milliseconds since the Unix epoch.
Syntax
$messageTimestamp
Parameters
None.
Return Value
| Type | Description |
|---|---|
integer |
Unix timestamp in milliseconds. |
Examples
Display the raw timestamp
$sendMessage[Message timestamp: $messageTimestamp]
Format the date
$sendMessage[Message sent on $formatDate[$messageTimestamp;MM/DD/YYYY at HH:mm:ss]]
Calculate the age of the message
$sendMessage[Message age: $truncate[$sub[$dateNow;$messageTimestamp]/1000] seconds.]
Display in Discord relative format
$sendMessage[Message sent <t:$truncate[$messageTimestamp/1000]:R>]
Notes
- The timestamp is returned in milliseconds. Divide by
1000to get seconds. - Use with
$formatDatefor a human-readable display. $dateNowreturns the current timestamp, useful for calculating durations.- For the edit timestamp, use
$messageEditedTimestamp.