Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetTodaysDate

From RoR Wiki

UI Lua API · Time functions
Version: WAR 1.4.8

Returns today's date from the computer's clock.

date = GetTodaysDate()

Arguments

None.

Returns

date
table – A table with these fields:
Key Type Meaning
todaysMonth number Month, 1–12.
todaysDay number Day of the month, 1–31.
todaysYear number Year, for example 2008.

Details

  • The date is the computer's local date, not the server's.
  • A new table is built on every call.
  • Arguments are not checked; anything passed is ignored.

Errors

None.

Example

From ea_guildwindow/source/calendar.lua:

function Calendar.SetTodaysDate()
	local todaysDate = GetTodaysDate()
	Calendar.todaysMonth = todaysDate.todaysMonth
	Calendar.todaysDay	 = todaysDate.todaysDay
	Calendar.todaysYear	 = todaysDate.todaysYear
end

See also