Zum Hauptinhalt springen

Time-Funktionen

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

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

    • Argumente:
      • time
    • Beispielergebnis: 3600000
      • Mit Eingabe: {ms;1h}
  • {msStr}: Converts milliseconds to a human readable time

    • Argumente:
      • time = "1h"
      • long = true
      • max = void 0
    • Beispielergebnis: 1 hour
      • Mit Eingabe: {msStr;3600000}
    • Beispielergebnis: 2h 30m
      • Mit Eingabe: {msStr;9042000;}
  • {day}: Returns the current day

    • Beispielergebnis: 23
  • {month}: Returns the current month

    • Beispielergebnis: 7
  • {year}: Returns the current year

    • Beispielergebnis: 2024
  • {hour}: Returns the current hour

    • Beispielergebnis: 5
  • {minute}: Returns the current minute

    • Beispielergebnis: 9
  • {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

    • Argumente:
      • format = "f"
      • date = Date.now()
    • Beispielergebnis: <t:1:f>
      • Mit Eingabe: {date;f;1000}
    • Beispielergebnis: <t:100000:R>
      • Mit Eingabe: {date;R;100000000}