<?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: DateTime calculations sometimes off one minute in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/datetime-calculations-sometimes-off-one-minute/m-p/1652971#M64241</link>
    <description>&lt;P&gt;This makes some date calculations difficult when the time is 12 AM time, because it will return the day before.&lt;/P&gt;&lt;P&gt;have you tried something like this?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Neal_t_k_0-1758745457909.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/140907i96C550DAC49FCDE4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Neal_t_k_0-1758745457909.png" alt="Neal_t_k_0-1758745457909.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(${Start_Time} + ${End_Time}) div 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Sep 2025 20:27:18 GMT</pubDate>
    <dc:creator>Neal_t_k</dc:creator>
    <dc:date>2025-09-24T20:27:18Z</dc:date>
    <item>
      <title>DateTime calculations sometimes off one minute</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/datetime-calculations-sometimes-off-one-minute/m-p/1652909#M64239</link>
      <description>&lt;P&gt;I have a form where the user enters a start DateTime and an end DateTime, then a third field calculates and displays the average of those two DateTimes. I recently discovered that sometimes the calculations are off by one minute.&lt;/P&gt;&lt;P&gt;I suspect that this is due to rounding issues and converting back and forth between DateTime and decimal-date-time to perform the calculations. &lt;A href="https://community.esri.com/t5/arcgis-survey123-questions/datetime-calculation-returns-incorrect-result-but/td-p/1002425" target="_blank" rel="noopener"&gt;Similar to this post&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;This is the equation I have been using to calculate and then display the average:&lt;/P&gt;&lt;P class="lia-align-center"&gt;date-time((decimal-date-time(${Start_Time}) + decimal-date-time(${End_Time})) div 2)&lt;/P&gt;&lt;P&gt;This is one of the equations I tried with a round applied (arbitrarily picked 10 decimal places):&lt;/P&gt;&lt;P class="lia-align-center"&gt;date-time(round((decimal-date-time(${Start_Time}) + decimal-date-time(${End_Time})) div 2, 10))&lt;/P&gt;&lt;P&gt;I've attached a simple XLS form to demonstrate this. For example, when entering 4:00 and 6:00, the average without rounding is a minute off at 4:59, whereas the average with rounding accurately shows 5:00:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="DateTime Average 4 and 6.png" style="width: 305px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/140890i54746F7ED40F89A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DateTime Average 4 and 6.png" alt="DateTime Average 4 and 6.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But when entering 3:00 and 6:00, the average without rounding shows 04:30 but the average with rounding is off by a minute and shows 04:29:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="DateTime Average 3 and 6.png" style="width: 314px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/140891iEC2184A42051C7F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DateTime Average 3 and 6.png" alt="DateTime Average 3 and 6.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've played around with applying the round in different parts of the equation, changed the number of rounded decimals, and used different sets of start and end times, but haven't yet been able to identify an equation that is accurate 100% of the time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a different equation that would produce the correct averages all of the time, or is this just a limitation of trying to average two DateTimes?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2025 18:36:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/datetime-calculations-sometimes-off-one-minute/m-p/1652909#M64239</guid>
      <dc:creator>ErikHerbergMETC</dc:creator>
      <dc:date>2025-09-24T18:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime calculations sometimes off one minute</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/datetime-calculations-sometimes-off-one-minute/m-p/1652971#M64241</link>
      <description>&lt;P&gt;This makes some date calculations difficult when the time is 12 AM time, because it will return the day before.&lt;/P&gt;&lt;P&gt;have you tried something like this?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Neal_t_k_0-1758745457909.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/140907i96C550DAC49FCDE4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Neal_t_k_0-1758745457909.png" alt="Neal_t_k_0-1758745457909.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(${Start_Time} + ${End_Time}) div 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2025 20:27:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/datetime-calculations-sometimes-off-one-minute/m-p/1652971#M64241</guid>
      <dc:creator>Neal_t_k</dc:creator>
      <dc:date>2025-09-24T20:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime calculations sometimes off one minute</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/datetime-calculations-sometimes-off-one-minute/m-p/1653185#M64254</link>
      <description>&lt;P&gt;That for the recommendation&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/763693"&gt;@Neal_t_k&lt;/a&gt;. It looks like this works as expected in the field app. The specific form I need this for is only used in the field app, so this will work for me.&lt;/P&gt;&lt;P&gt;However, this solution doesn't work in the web app, I'm assuming because &lt;A href="https://community.esri.com/t5/arcgis-survey123-blog/dates-and-time-in-survey123/ba-p/895528" target="_blank" rel="noopener"&gt;the web app only supports decimal time&lt;/A&gt;. I would still be interested in a solution that works using decimal dates, if it's possible.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2025 14:24:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/datetime-calculations-sometimes-off-one-minute/m-p/1653185#M64254</guid>
      <dc:creator>ErikHerbergMETC</dc:creator>
      <dc:date>2025-09-25T14:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime calculations sometimes off one minute</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/datetime-calculations-sometimes-off-one-minute/m-p/1653250#M64257</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/478410"&gt;@ErikHerbergMETC&lt;/a&gt;&amp;nbsp;I can't really explain this issue, I was able to get something that appears to give consistent date/time calcs in both Connect and the web...It is not intuitive.&lt;/P&gt;&lt;P&gt;The calculation above should work but for some reason doesn't in the web app, it seems not to register the calculation the same as Connect. So i had to make helper fields and multiply by 1 to get it to calculate properly, but then I was seeing the same phenomena you describe with the min difference. So I added 0.0001 to both numbers.&amp;nbsp; I don't know if it will break elsewhere, but it appears to consistent...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Neal_t_k_0-1758818741055.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/140964iC65AC5F272DDC248/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Neal_t_k_0-1758818741055.png" alt="Neal_t_k_0-1758818741055.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2025 16:46:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/datetime-calculations-sometimes-off-one-minute/m-p/1653250#M64257</guid>
      <dc:creator>Neal_t_k</dc:creator>
      <dc:date>2025-09-25T16:46:30Z</dc:date>
    </item>
  </channel>
</rss>

