إنتقل إلى المحتوى الرئيسي

DateTime():isAfter()

يتحقق ما إذا كان كائن DateTime الحالي بعد كائن DateTime آخر.

التوقيع

isAfter(other: DateTime): boolean

المعاملات

المعاملالنوعالوصف
otherDateTimeكائن DateTime الآخر للمقارنة به.

القيمة المعادة

  • النوع: boolean
  • true إذا كان DateTime الحالي يأتي بعد other بشكل صارم، و false بخلاف ذلك.

أمثلة

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))