<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Calculate the date 6 months old from today</title><link>https://community.appian.com/discussions/f/data/13748/calculate-the-date-6-months-old-from-today</link><description>Calculate the date 6 months old from today, please advise with recipes</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Calculate the date 6 months old from today</title><link>https://community.appian.com/thread/108739?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2023 13:29:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f933d391-c680-4be0-8231-ffbad5837b8a</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Would you please stop&amp;nbsp;recommending such code snippets!&lt;/p&gt;
&lt;p&gt;Appian expressions is a functional language and local variables cannot be modified after initial assignment. Your code does not append anything to that local!b.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate the date 6 months old from today</title><link>https://community.appian.com/thread/108738?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2023 13:27:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a44033a0-4a54-4191-9c61-9b70f58494ac</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Try this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;year(today()) - enumerate(3)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate the date 6 months old from today</title><link>https://community.appian.com/thread/108737?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2023 13:23:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:52799f6e-04fa-499a-8861-fa7f2113ba0e</guid><dc:creator>anups4671</dc:creator><description>&lt;p&gt;Hi pd5143, Kindly try this solution&lt;br /&gt;&lt;br /&gt;a!localVariables(&lt;br /&gt; local!a:year(today()),&lt;br /&gt; local!b,&lt;br /&gt; a!flatten(&lt;br /&gt; a!forEach(&lt;br /&gt; items: enumerate(3),&lt;br /&gt; expression: append(local!b,local!a-(fv!index-1))&lt;br /&gt; )),&lt;br /&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate the date 6 months old from today</title><link>https://community.appian.com/thread/108272?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2023 16:14:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:11fc095d-444a-4a70-9937-da6d6cc03911</guid><dc:creator>pd5143</dc:creator><description>&lt;p&gt;how to get past 3 year from now?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate the date 6 months old from today</title><link>https://community.appian.com/thread/88151?ContentTypeID=1</link><pubDate>Fri, 19 Nov 2021 10:11:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:87325d4e-bc46-43c4-a467-0b9cda9c826c</guid><dc:creator>Madhu Sudhan Reddy Bapatu</dc:creator><description>&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate the date 6 months old from today</title><link>https://community.appian.com/thread/88150?ContentTypeID=1</link><pubDate>Fri, 19 Nov 2021 10:10:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:73bf86ff-b9ce-44cf-98fb-2f6da76952b4</guid><dc:creator>Madhu Sudhan Reddy Bapatu</dc:creator><description>&lt;p&gt;edate(today(), -6)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate the date 6 months old from today</title><link>https://community.appian.com/thread/88149?ContentTypeID=1</link><pubDate>Fri, 19 Nov 2021 09:48:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:33158c7c-3825-4c45-881d-f940a5116fd8</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;It can be simplified even more by using the built in function edate()&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/21.4/fnc_date_and_time_edate.html"&gt;docs.appian.com/.../fnc_date_and_time_edate.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate the date 6 months old from today</title><link>https://community.appian.com/thread/88147?ContentTypeID=1</link><pubDate>Fri, 19 Nov 2021 06:43:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4fddcfa6-c441-48ef-ba3e-84bd3bf7b33a</guid><dc:creator>hrishikeshd997</dc:creator><description>&lt;p&gt;This can be simplified as follows -&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if(
  and(eomonth(ri!inputDate, 0) = ri!inputDate, month(ri!inputDate) &amp;lt;&amp;gt; 2),
  eomonth(ri!inputDate, -ri!numOfmonthsBack),
  eomonth(ri!inputDate, - (ri!numOfmonthsBack+1)) + day(ri!inputDate)
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;FYI this website is useful for validation&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.timeanddate.com/date/dateadd.html"&gt;https://www.timeanddate.com/date/dateadd.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate the date 6 months old from today</title><link>https://community.appian.com/thread/88144?ContentTypeID=1</link><pubDate>Fri, 19 Nov 2021 05:01:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d41512c4-367e-4490-be2c-3e9e2678c9cd</guid><dc:creator>Madhu Sudhan Reddy Bapatu</dc:creator><description>&lt;p&gt;todate(concat(month(ri!date1)-6,&amp;quot;/&amp;quot;,day(ri!date1),&amp;quot;/&amp;quot;,year(ri!date1)))&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate the date 6 months old from today</title><link>https://community.appian.com/thread/62388?ContentTypeID=1</link><pubDate>Wed, 07 Nov 2018 18:26:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bbcbfb47-e865-40a2-b42f-31b28359f0e7</guid><dc:creator>omere0001</dc:creator><description>Here is a code snippet that will return 6 months from the previous day. It also takes into account years, so 6 months ago from January will return July of the previous year. I also added error handling for if the day of the month is greater than the number of days in the previous month (i.e no February 31st). In that scenario it will just return the last day of the month.&lt;br /&gt;
&lt;br /&gt;
date(&lt;br /&gt;
  year(eomonth(today(), -6)),&lt;br /&gt;
  month(eomonth(today(), -6)),&lt;br /&gt;
  day(&lt;br /&gt;
    if(&lt;br /&gt;
      day(today()) &amp;gt; daysinmonth(month(eomonth(today(), -6)), year(eomonth(today(), -6))),&lt;br /&gt;
      eomonth(today(), -6),&lt;br /&gt;
      today()&lt;br /&gt;
    )&lt;br /&gt;
  )&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Just replace all of the -6 with however many months back you want.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate the date 6 months old from today</title><link>https://community.appian.com/thread/62382?ContentTypeID=1</link><pubDate>Wed, 07 Nov 2018 15:16:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ae07f5cd-fb80-479b-91d1-0c7168fdb802</guid><dc:creator>Chanakya Volam</dc:creator><description>Hi &lt;a href="/members/miguelg220"&gt;Miguel Garcia-Gonzalez&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
eomonth() function only returns the last day of the month but not the exact date minus number of months&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate the date 6 months old from today</title><link>https://community.appian.com/thread/62380?ContentTypeID=1</link><pubDate>Wed, 07 Nov 2018 14:22:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a48b4356-1731-4a68-b236-b20a42d03dc7</guid><dc:creator>Miguel Garcia-Gonzalez</dc:creator><description>You can use a date function provided by Appian called eomonth(), I think it does what you are asking for.&lt;br /&gt;
&lt;br /&gt;
Please refer to: &lt;a href="https://docs.appian.com/suite/help/18.3/fnc_date_and_time_eomonth.html"&gt;docs.appian.com/.../fnc_date_and_time_eomonth.html&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate the date 6 months old from today</title><link>https://community.appian.com/thread/62379?ContentTypeID=1</link><pubDate>Wed, 07 Nov 2018 14:19:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9e93565d-ae59-49d4-bf1e-b0cf4398b877</guid><dc:creator>malavikak0001</dc:creator><description>I think I found the answer, plugin called Date and Time Functions has some called subtractmonths(now(), 6)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>