<?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>Negative interval(day to second) to positive</title><link>https://community.appian.com/discussions/f/general/30538/negative-interval-day-to-second-to-positive</link><description>Hi Team, I&amp;#39;m having a function which calculates the time difference between a date time( output of a rule) and now(). then applying hour() to find how many hours it differing. But incase I&amp;#39;m checking this at 06-11-2023 7:00 am(output of rule) and my current</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Negative interval(day to second) to positive</title><link>https://community.appian.com/thread/121342?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2023 07:35:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6c4be72d-8e00-4051-a151-e769bd4d755b</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;In Appian, the difference between two dates is called an interval. Intervals are stored as decimals internally. This means, you can use the abs() function to get the positive value.&lt;/p&gt;
&lt;p&gt;Some example code below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!firstDate: datetime(2023, 11, 6, 7, 0, 0, 0),
  local!secondDate: datetime(2023, 11, 6, 7, 1, 0, 0),

  tointervalds(
    abs(
      todecimal(local!secondDate - local!firstDate)
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>