<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculating Hours between two Time questions in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-hours-between-two-time-questions/m-p/1339237#M52385</link>
    <description>&lt;P&gt;Question,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get this to work 12:00 PM- 1:23 PM:&lt;/P&gt;&lt;P&gt;round((decimal-date-time(${OthReleaseTime}) - decimal-date-time(${DispatchedDateTime})) * 24,1)&lt;/P&gt;&lt;P&gt;Returns a value = 1&lt;/P&gt;&lt;P&gt;but I don't want it to round.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example 8:18 PM - 4:45 PM = 3.55&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Oct 2023 17:25:00 GMT</pubDate>
    <dc:creator>ChristopherMask</dc:creator>
    <dc:date>2023-10-18T17:25:00Z</dc:date>
    <item>
      <title>Calculating Hours between two Time questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-hours-between-two-time-questions/m-p/769876#M3479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to wrap my head around calculating hours between two TIME fields. There are alot of blog posts around this, but none that I have found that give me hours worked in this format:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start Time = 10am&lt;/P&gt;&lt;P&gt;Finish Time = 2.30pm&lt;/P&gt;&lt;P&gt;Calculation == 4.5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the below excel document, can someone please tell me how to get the result I am looking form?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this is a simple one but I can't get it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See row 12 &amp;amp; 13 below&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="/legacyfs/online/486274_2020-03-26 10_49_47-Time Logger.xlsx - Excel.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try doing&amp;nbsp;${time_end}-${time_start}/3600000 but I get this error:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji jive-image image-2 j-img-original" src="/legacyfs/online/486278_2020-03-26 10_55_10-Survey123 Connect for ArcGIS.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Note: I know there is a reference error on line 13 in the screenshot, it has been resolved, it is unrelated to this question&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2020 23:56:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-hours-between-two-time-questions/m-p/769876#M3479</guid>
      <dc:creator>BenVan_Kesteren1</dc:creator>
      <dc:date>2020-03-25T23:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Hours between two Time questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-hours-between-two-time-questions/m-p/769877#M3480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ben&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The trick is to convert the time questions to decimal time. So your calculation would look something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;round((decimal-time(${time_end}) - decimal-time(${time_start})) * 24,1)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the web app supports decimal time only, while the field app supports Epoch time and decimal time. This Help topic gives a good comparison of the two storage methods:&amp;nbsp;&lt;A class="link-titled" href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/decimaldatetime.htm" title="https://doc.arcgis.com/en/survey123/desktop/create-surveys/decimaldatetime.htm"&gt;Decimal date time—Survey123 for ArcGIS | Documentation&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this blog post covers all the ins and outs of working with dates and times:&amp;nbsp;&lt;A href="https://community.esri.com/groups/survey123/blog/2016/04/17/dates-and-time-in-survey123-for-arcgis"&gt;https://community.esri.com/groups/survey123/blog/2016/04/17/dates-and-time-in-survey123-for-arcgis&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As mentioned in the blog, there's a handy &lt;STRONG&gt;Dates &amp;amp; Time&lt;/STRONG&gt; sample survey available in Connect which has plenty of good examples. Also see&amp;nbsp;the comments in the blog post regarding issues with rounding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2020 01:40:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-hours-between-two-time-questions/m-p/769877#M3480</guid>
      <dc:creator>Jim-Moore</dc:creator>
      <dc:date>2020-03-26T01:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Hours between two Time questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-hours-between-two-time-questions/m-p/769878#M3481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/346771" target="_blank"&gt;Jim&lt;/A&gt;&amp;nbsp;that works perfectly, exactly answers my question. I will now refer to the supplied literature to build my knowledge around this, as it may answer my follow up question, which is;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The brief of this project has changed now to allow for people to register a shift which could occur over many days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g If I worked from 2100 Saturday night until 0300 Sunday morning, that's a 6 hour shift I need to capture. So I have just changed my start/stop fields to be date/time, and updated my calculation according to the above hyperlink you provided:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;round((decimal-date-time(${shift_end}) - decimal-date-time(${shift_start})) * 24,1)
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Works perfectly, thanks again for the excellent information you provided above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:35:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-hours-between-two-time-questions/m-p/769878#M3481</guid>
      <dc:creator>BenVan_Kesteren1</dc:creator>
      <dc:date>2021-12-12T08:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Hours between two Time questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-hours-between-two-time-questions/m-p/769879#M3482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cheers Ben, glad to hear it's working well!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Mar 2020 23:23:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-hours-between-two-time-questions/m-p/769879#M3482</guid>
      <dc:creator>Jim-Moore</dc:creator>
      <dc:date>2020-03-29T23:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Hours between two Time questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-hours-between-two-time-questions/m-p/1339237#M52385</link>
      <description>&lt;P&gt;Question,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get this to work 12:00 PM- 1:23 PM:&lt;/P&gt;&lt;P&gt;round((decimal-date-time(${OthReleaseTime}) - decimal-date-time(${DispatchedDateTime})) * 24,1)&lt;/P&gt;&lt;P&gt;Returns a value = 1&lt;/P&gt;&lt;P&gt;but I don't want it to round.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example 8:18 PM - 4:45 PM = 3.55&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 17:25:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-hours-between-two-time-questions/m-p/1339237#M52385</guid>
      <dc:creator>ChristopherMask</dc:creator>
      <dc:date>2023-10-18T17:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Hours between two Time questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-hours-between-two-time-questions/m-p/1339311#M52396</link>
      <description>&lt;P&gt;Question,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get this to work 12:00 PM- 1:23 PM:&lt;/P&gt;&lt;P&gt;round((decimal-date-time(${OthReleaseTime}) - decimal-date-time(${DispatchedDateTime})) * 24,1)&lt;/P&gt;&lt;P&gt;Returns a value = 1&lt;/P&gt;&lt;P&gt;but I don't want it to round.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example 8:18 PM - 4:45 PM = 3.55&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 19:45:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-hours-between-two-time-questions/m-p/1339311#M52396</guid>
      <dc:creator>ChristopherMask</dc:creator>
      <dc:date>2023-10-18T19:45:48Z</dc:date>
    </item>
  </channel>
</rss>

