Aller au contenu principal

DateTime():month()

Returns the month of the DateTime object. (1-based, January is 1).

Signature

month(): number

Returns

  • Type: number
  • The month (1-12).

Examples

local date = DateTime(2024, 3, 15) -- March 15, 2024
local month = date:month()
toast("Month: " .. month) -- Output: 3