<?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>Date and time comparison</title><link>https://community.appian.com/discussions/f/general/30666/date-and-time-comparison</link><description>I am having date and time of submitted form in Date time format. I want to compare the date and time if it exceeds 1 hr from submission I want to show a proceed button. 
 How I can give a condition where it is comparing submitted form have completed </description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Date and time comparison</title><link>https://community.appian.com/thread/121985?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2023 10:25:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:05a6ab29-c124-4438-b0c6-6d3cc69ebe9a</guid><dc:creator>vikashk7323</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  /* Date from DB */
  local!dateTime: todatetime(&amp;quot;20/11/2023 09:45&amp;quot;),
  /* Extract time */
  local!time: totime(local!dateTime),
  /* Get hour by having difference */
  local!differnce: tointeger(
    index(
      split(totime(now() - local!time), &amp;quot;:&amp;quot;),
      1,
      null()
    )
  ),
  /* Get the required value based on calculation */
  if(local!differnce &amp;gt;= 1, true, false)
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="/members/harshc5309"&gt;harshc5309&lt;/a&gt;&amp;nbsp;, you can create a rule which calculates the difference and based on that you can either show or hide buttons.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date and time comparison</title><link>https://community.appian.com/thread/121982?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2023 10:12:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d41c94e-f574-4ea8-83bf-400f5b2f73d2</guid><dc:creator>Sri Ram Kaja</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="/members/harshc5309"&gt;harshc5309&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;Please use below code. Here local!proceedButton is a boolean which can be used for showWhen or disable parameter of buttonWidget.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!submittedTime:datetime(2023,11,20,03,35,00),
  local!proceedButton:a!addDateTime(local!submittedTime,0,0,0,1,0,0)&amp;gt;now(),
  local!proceedButton
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date and time comparison</title><link>https://community.appian.com/thread/121981?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2023 10:11:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aeeca309-0b47-4fbe-abc2-be83c9496a52</guid><dc:creator>gopalt0943</dc:creator><description>&lt;p&gt;Assume the variable &amp;quot;submissionDatTime&amp;quot;. that holds the submitted date and time. then, after you want to show the proceed button, if more than 1 hour has passed since submission.&lt;br /&gt;Use this expression:&lt;br /&gt;if(&lt;/p&gt;
&lt;p&gt;currentDateTime() - submissionDateTime &amp;gt; 1 hour,&lt;br /&gt;true,&lt;/p&gt;
&lt;p&gt;false,&lt;/p&gt;
&lt;p&gt;)&lt;br /&gt;current DateTime get your current date and time&lt;/p&gt;
&lt;p&gt;submissionDateTime shows your form&amp;#39;s submitted date and time.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;currentDateTime() - submissionDateTime , calculate the difference between these times.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1 hour is a threshold you want to check against. if your time difference is greater than 1 hour, the condition is true. then it will eveluate to true, and you can use this condition to visibility of proceed button.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>