Aller au contenu principal

DateTime():isSameOrAfter()

Checks if the current DateTime object is the same as or after another DateTime object.

Signature

isSameOrAfter(other: DateTime): boolean

Parameters

ParameterTypeDescription
otherDateTimeThe other DateTime object to compare against.

Returns

  • Type: boolean
  • true if the current DateTime is the same as or after the other DateTime, false otherwise.

Examples

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

local result1 = date1:isSameOrAfter(date2) -- result will be true
toast(tostring(result1))

local result2 = date1:isSameOrAfter(date3) -- result will be true
toast(tostring(result2))

local result3 = date2:isSameOrAfter(date1) -- result will be false
toast(tostring(result3))