Skip to main content

Time functions

  • {formatDate}: Formats the given date in the given timezone using the given language

    • Arguments:
      • date = Date.now(
      • langCode = "en-US"
      • timeZone = "Europe/Berlin")
    • Example result: 1/1/1970, 1:00:00 AM
      • Using input: {formatDate;1}
    • Example result: 3.3.1973, 09:46:40
      • Using input: {formatDate;100000000000;de-DE;UTC}
  • {ms}: Converts a human readable time to milliseconds

    • Arguments:
      • time
    • Example result: 3600000
      • Using input: {ms;1h}
  • {msStr}: Converts milliseconds to a human readable time

    • Arguments:
      • time = "1h"
      • long = true
      • max = void 0
    • Example result: 1 hour
      • Using input: {msStr;3600000}
    • Example result: 2h 30m
      • Using input: {msStr;9042000;}
  • {day}: Returns the current day

    • Example result: 17
  • {month}: Returns the current month

    • Example result: 5
  • {year}: Returns the current year

    • Example result: 2024
  • {hour}: Returns the current hour

    • Example result: 5
  • {minute}: Returns the current minute

    • Example result: 7
  • {second}: Returns the current second

  • {millisecond}: Returns the current millisecond

  • {unix}: Returns the current epoch time in seconds

  • {unixms}: Returns the current unix time in milliseconds

  • {date}: Formats a given date using a Discord timestamp in the given format

    • Arguments:
      • format = "f"
      • date = Date.now()
    • Example result: <t:1:f>
      • Using input: {date;f;1000}
    • Example result: <t:100000:R>
      • Using input: {date;R;100000000}