Zum Hauptinhalt springen

DateTime():isSameOrAfter()

Prüft, ob das aktuelle DateTime-Objekt mit einem anderen DateTime-Objekt identisch ist oder danach liegt.

Signatur

isSameOrAfter(other: DateTime): boolean

Parameter

ParameterTypBeschreibung
otherDateTimeDas andere DateTime-Objekt für den Vergleich.

Rückgabe

  • Typ: boolean
  • true, wenn das aktuelle DateTime mit dem other DateTime identisch ist oder danach liegt, andernfalls false.

Beispiele

local date1 = DateTime(2024, 1, 10)
local date2 = DateTime(2024, 1, 5)
local date3 = DateTime(2024, 1, 10)

local result1 = date1:isSameOrAfter(date2) -- Ergebnis ist true
toast(tostring(result1))

local result2 = date1:isSameOrAfter(date3) -- Ergebnis ist true
toast(tostring(result2))

local result3 = date2:isSameOrAfter(date1) -- Ergebnis ist false
toast(tostring(result3))