<?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>How can we get difference between two times ?</title><link>https://community.appian.com/discussions/f/rules/27567/how-can-we-get-difference-between-two-times</link><description>Hi All, 
 I am having two times saves in 2 variables 
 Eg: 1) 2/5/2023 9:00 AM GMT+05:30. 2) 2/5/2023 8:00 PM GMT+05:30 
 now my ask is what function we should use in order to get the output like output : 11 hrs or in minuts 
 and also same for dates</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How can we get difference between two times ?</title><link>https://community.appian.com/thread/116466?ContentTypeID=1</link><pubDate>Wed, 19 Jul 2023 13:09:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d6eca55f-5123-4eaa-aefb-91d34bc8d76f</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Generally you can just subtract a datetime value from another, it just takes some effort to meaningfully unpack the result.&amp;nbsp; Here&amp;#39;s my quick attempt at something simple:&lt;br /&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  
  local!time1: datetime(2023, 02, 05, 09, 04),  
  local!time2: datetime(2023, 02, 05, 20, 02),
  
  local!difference: local!time2 - local!time1,
  
  a!map(
    days: tointeger(local!difference),
    hours: hour(local!difference),
    minutes: minute(local!difference),
  )
)&lt;/pre&gt;&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/pastedimage1689772101385v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get difference between two times ?</title><link>https://community.appian.com/thread/116458?ContentTypeID=1</link><pubDate>Wed, 19 Jul 2023 11:25:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b1be9bdb-af8c-48ff-86ff-eb0f8a308b18</guid><dc:creator>samarm0001</dc:creator><description>&lt;p&gt;Thanks &lt;a href="/members/yanaln6436"&gt;Yanal&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get difference between two times ?</title><link>https://community.appian.com/thread/108143?ContentTypeID=1</link><pubDate>Sun, 19 Feb 2023 01:19:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:43e75069-96ef-45aa-9b31-e3081d7f9bb5</guid><dc:creator>frankt54</dc:creator><description>&lt;p&gt;you are welcome&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get difference between two times ?</title><link>https://community.appian.com/thread/108133?ContentTypeID=1</link><pubDate>Sat, 18 Feb 2023 10:53:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:56e75fb6-79e5-4c7f-8a7b-3d7e2635deb6</guid><dc:creator>nikkheelm4742</dc:creator><description>&lt;p&gt;working thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get difference between two times ?</title><link>https://community.appian.com/thread/108059?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2023 02:58:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:62127432-cef8-41e9-af33-730b96e5812b</guid><dc:creator>frankt54</dc:creator><description>&lt;p&gt;I don&amp;#39;t know if this is what you are looking for, but you can use a!elapseTime and then map the result like the picture below.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/pastedimage1676602750176v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get difference between two times ?</title><link>https://community.appian.com/thread/107564?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2023 08:23:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b744b97b-70bd-4b6a-a047-359e32c93c50</guid><dc:creator>nikkheelm4742</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/Screenshot-2023_2D00_02_2D00_08-135348.png" /&gt;&lt;/p&gt;
&lt;p&gt;Not getting correct answer&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get difference between two times ?</title><link>https://community.appian.com/thread/107489?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2023 20:01:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:13f61c99-d8ea-4478-97f9-5d82b09b2105</guid><dc:creator>nikkheelm4742</dc:creator><description>&lt;p&gt;how can we capture only time from the user is there any specific field of we just need to give 2 drop downs for hours and minutes&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get difference between two times ?</title><link>https://community.appian.com/thread/107466?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2023 09:28:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fddc5dc6-63e3-4595-91ad-5f6648046168</guid><dc:creator>Yanal</dc:creator><description>&lt;p&gt;ah, so you don&amp;#39;t have the plugin, my bad, here&amp;#39;s the equivalent of the above but by using Appian built-in functions:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!firstDateTime: now(),
  local!secondDateTime: now() - intervalds(28, 15, 0),
  local!differenceTimeValue: timevalue(
    local!firstDateTime - local!secondDateTime
  ),
  a!map(
    mintuesDifference: minute(local!differenceTimeValue),
    hoursDifference: hour(local!differenceTimeValue),
    hoursWithMinutes: local!differenceTimeValue,
    dateDifference: days360(
      local!secondDateTime,
      local!firstDateTime
    )
  )
)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;edit: note that if you want to get the total hours or minutes difference, then you should add the hours or minutes with the days difference (* 24) or (* 24 * 60 (incase of the minutes)) .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get difference between two times ?</title><link>https://community.appian.com/thread/107462?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2023 08:50:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:851f6894-129e-4610-b5ec-4da7d70528f2</guid><dc:creator>gayathris876948</dc:creator><description>&lt;p&gt;Its a custom function, available under this plugin&lt;br /&gt;&lt;br /&gt;&lt;a href="https://community.appian.com/b/appmarket/posts/date-and-time-utilities"&gt;community.appian.com/.../date-and-time-utilities&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get difference between two times ?</title><link>https://community.appian.com/thread/107461?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2023 08:38:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7ca8056b-8f3a-417c-8efc-cebe21aa19a0</guid><dc:creator>Yanal</dc:creator><description>&lt;p&gt;elapsedtime()... my locals&amp;#39; names are self-explanatory, its right there mate, I recommend reading the function description to fully understand it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get difference between two times ?</title><link>https://community.appian.com/thread/107443?ContentTypeID=1</link><pubDate>Sun, 05 Feb 2023 16:32:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c3e983be-ce36-4c44-ac3d-f334fa0e026b</guid><dc:creator>nikkheelm4742</dc:creator><description>&lt;p&gt;Thank you for the answer&amp;nbsp;elapseddays() function is not avaliable&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get difference between two times ?</title><link>https://community.appian.com/thread/107442?ContentTypeID=1</link><pubDate>Sun, 05 Feb 2023 16:22:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fabe5b39-46f1-4946-9ade-20096c2be249</guid><dc:creator>Yanal</dc:creator><description>&lt;p&gt;After.. decrypting.. your question, I understood that you want to find the difference in time between 2 date/dateTime values, here you go mate; this should help:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!firstDateTime: now(),
  local!secondDateTime: subtractminutes(subtracthours(now(), 4), 15),
  local!timeDifference: elapsedtime(
    local!secondDateTime,
    local!firstDateTime
  ),
  a!map(
    mintuesDifference: local!timeDifference[5],
    hoursDifference: local!timeDifference[4],
    dateDifference: elapseddays(
      local!secondDateTime,
      local!firstDateTime
    ),
    hoursWithMinutes: time(
      local!timeDifference[4],
      local!timeDifference[5]
    )
  )
)&lt;/pre&gt;&lt;br /&gt;also consider checking these sections for later requirements on date manipulations.&amp;nbsp;&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/pastedimage1675614217975v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>