Skip to content

$formatDate

$formatDate will format a given date.

Usage

$formatDate[date;format?]

Parameters

FieldTypeDescriptionRequired
datenumberThe date you want to format.true
format?stringThe format that will be used to display the date (listed below).false

Date Formatting

FormatReturns
ddddReturns the weekday, Monday, Tuesday, Wednesday …String
ddReturns the abbreviation of the weekday, Mon, Tue, Wed …String
DReturns the day of the monthNumber
DDReturns the day of the monthString
DDDReturns the day of the year, 256, 257 …Number
M / MMReturns the month of the year, 10, 11 …Number
MMMReturns the abbreviation of the month, Jan, Feb …String
MMMMReturns the month fully January, February …String
YYYYReturns year fully, 2020, 2021 …Number
YYReturns the last two digits of the year, 20, 21 …Number

Example(s)

This will return your current date in the dddd, DD MMMM YYYY format:

1
client.command({
2
name: "formatDate",
3
code: `
4
$formatDate[$dateStamp;dddd, DD MMMM YYYY]
5
`
6
});