본문으로 건너뛰기

DateTime():isAfter()

현재 DateTime 객체가 다른 DateTime 객체보다 이후인지 확인합니다.

시그니처

isAfter(other: DateTime): boolean

매개변수

매개변수유형설명
otherDateTime비교할 다른 DateTime 객체.

반환값

  • 유형: boolean
  • 현재 DateTimeother DateTime보다 명확하게 이후이면 true, 그렇지 않으면 false.

예시

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

local result1 = date1:isAfter(date2) -- 결과는 true
toast(tostring(result1))

local result2 = date2:isAfter(date1) -- 결과는 false
toast(tostring(result2))