Skip to content

$time

$time returns the current time in a specified format.

Usage

$time[format;isAmPm?]

Parameters

FieldTypeDescriptionRequired
formatstringThe output format using {hour}, {minute}, {second}, {am} placeholders.true
isAmPm?booleanWhether to use 12-hour format with AM/PM. Default: falsefalse

Example(s)

This will return the current time in HH:MM:SS format:

1
client.command({
2
name: "currentTime",
3
code: `
4
$time[{hour}:{minute}:{second}]
5
`
6
});

This will return the current time in 12-hour format with AM/PM:

1
client.command({
2
name: "currentTimeAMPM",
3
code: `
4
$time[{hour}:{minute}:{second} {am};true]
5
`
6
});