Aller au contenu principal

DateTime():year()

Renvoie l'année de l'objet DateTime.

Signature

year(): number

Renvoie

  • Type : number
  • L'année (par ex., 2024).

Exemples

local date = DateTime(2024, 1, 15)
local year = date:year()
toast("Year: " .. year) -- Output: 2024