Aller au contenu principal

DateTime():day()

Returns the day of the week of the DateTime object. (Sunday is 0, Monday is 1, etc.).

Signature

day(): number

Returns

  • Type: number
  • The day of the week (0-6).

Examples

local date = DateTime(2024, 1, 15, 10, 30, 0) -- A Tuesday
local dayOfWeek = date:day()
toast("Day of the week: " .. dayOfWeek) -- Output: 2 (Tuesday)