DateTime():isSame()
يتحقق ما إذا كان كائن DateTime الحالي مطابقًا لكائن DateTime آخر.
التوقيع
isSame(other: DateTime): boolean
المعاملات
| المعامل | النوع | الوصف |
|---|---|---|
other | DateTime | كائن DateTime الآخر للمقارنة به. |
القيمة المعادة
- النوع:
boolean trueإذا كانDateTimeالحالي مطابقًا لـother، وfalseبخلاف ذلك.
أمثلة
local date1 = DateTime(2024, 1, 10, 10, 30, 0)
local date2 = DateTime(2024, 1, 10, 10, 30, 0)
local date3 = DateTime(2024, 1, 10, 11, 0, 0)
local result1 = date1:isSame(date2) -- result will be true
toast(tostring(result1))
local result2 = date1:isSame(date3) -- result will be false
toast(tostring(result2))