<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetYearMonthName</id>
	<title>API:GetYearMonthName - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetYearMonthName"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetYearMonthName&amp;action=history"/>
	<updated>2026-10-17T08:25:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:GetYearMonthName&amp;diff=30488&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetYearMonthName&amp;diff=30488&amp;oldid=prev"/>
		<updated>2026-10-16T19:45:22Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Time}}&lt;br /&gt;
Returns a month and year written the way the computer&amp;#039;s regional settings write them, for example as a calendar title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
text = GetYearMonthName(year, month)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;year : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – The year, 1900 or later. Fractions are dropped.&lt;br /&gt;
;month : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – The month, 1 to 12. Fractions are dropped.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;text : &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; – The formatted year and month.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The text is produced by Windows&amp;#039; date formatting with the &amp;quot;year and month&amp;quot; format of the current thread locale, for the first day of the given month.&lt;br /&gt;
* A &amp;lt;code&amp;gt;year&amp;lt;/code&amp;gt; below 1900 or a &amp;lt;code&amp;gt;month&amp;lt;/code&amp;gt; outside 1–12 logs the matching error and returns nothing.&lt;br /&gt;
* If Windows cannot format the date, the third error is logged and an empty string is returned.&lt;br /&gt;
* The argument check is shared with [[API:GetMonthName|GetMonthName]]: if an argument is missing or not a number, the &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message names that function.&lt;br /&gt;
* The function needs at least two arguments and only reads the last two.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
These are written to the UI log; the call returns normally.&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;GetYearMonthName&amp;#039;: The year index[%u] is invalid. Year index should be greater than 1900!&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;GetYearMonthName&amp;#039;: The month index[%u] is invalid. Month index should be between 1 and 12!&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;GetYearMonthName&amp;#039;: Could not get valid year month name string for year[%u] month[%u]!&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;ea_guildwindow/source/calendar.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LabelSetText( &amp;quot;CalendarYearMonthLabel&amp;quot;, GetYearMonthName( Calendar.year, Calendar.month ) )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetMonthName|GetMonthName]]&lt;br /&gt;
* [[API:GetTodaysDate|GetTodaysDate]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>