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 1000 to get seconds.
  • Use with $formatDate for a human-readable display.
  • $dateNow returns the current timestamp, useful for calculating durations.
  • For the edit timestamp, use $messageEditedTimestamp.