DateTime():isAfter()
Checks if the current DateTime object is after another DateTime object.
Signature
isAfter(other: DateTime): boolean
Parameters
| Parameter | Type | Description |
|---|---|---|
other | DateTime | The other DateTime object to compare against. |
Returns
- Type:
boolean trueif the currentDateTimeis strictly after theotherDateTime,falseotherwise.
Examples
local date1 = DateTime(2024, 1, 10)
local date2 = DateTime(2024, 1, 5)
local result1 = date1:isAfter(date2) -- result will be true
toast(tostring(result1))
local result2 = date2:isAfter(date1) -- result will be false
toast(tostring(result2))