<?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 Update integer field with DateDiff in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/update-integer-field-with-datediff/m-p/1388053#M79453</link>
    <description>&lt;P&gt;I've been asked to create an Arcade script that calculates the difference between the start and end date of a project. The value should populate an integer field with hours. The start and end date fields are formatted with date and time, because we need to track to the hour how long is spent working on the project.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the below script and fields. I would like to implement this as an attribute rule going forward. Any idea how to get it to automatically populate the TimeDiff field? I'm assuming the inclusion of time is the issue, but I need to include it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MikhaylaB_1-1709130393846.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/96130iEA520A4236A16411/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MikhaylaB_1-1709130393846.png" alt="MikhaylaB_1-1709130393846.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MikhaylaB_0-1709130369476.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/96129i47FE179A007BB8D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MikhaylaB_0-1709130369476.png" alt="MikhaylaB_0-1709130369476.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Feb 2024 14:34:08 GMT</pubDate>
    <dc:creator>MikhaylaB</dc:creator>
    <dc:date>2024-02-28T14:34:08Z</dc:date>
    <item>
      <title>Update integer field with DateDiff</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-integer-field-with-datediff/m-p/1388053#M79453</link>
      <description>&lt;P&gt;I've been asked to create an Arcade script that calculates the difference between the start and end date of a project. The value should populate an integer field with hours. The start and end date fields are formatted with date and time, because we need to track to the hour how long is spent working on the project.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the below script and fields. I would like to implement this as an attribute rule going forward. Any idea how to get it to automatically populate the TimeDiff field? I'm assuming the inclusion of time is the issue, but I need to include it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MikhaylaB_1-1709130393846.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/96130iEA520A4236A16411/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MikhaylaB_1-1709130393846.png" alt="MikhaylaB_1-1709130393846.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MikhaylaB_0-1709130369476.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/96129i47FE179A007BB8D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MikhaylaB_0-1709130369476.png" alt="MikhaylaB_0-1709130369476.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 14:34:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-integer-field-with-datediff/m-p/1388053#M79453</guid>
      <dc:creator>MikhaylaB</dc:creator>
      <dc:date>2024-02-28T14:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Update integer field with DateDiff</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-integer-field-with-datediff/m-p/1388081#M79457</link>
      <description>&lt;P&gt;This works:&lt;/P&gt;&lt;P&gt;var StartDate = $feature.TimeStart&lt;BR /&gt;var EndDate = $feature.TimeEnd&lt;BR /&gt;var TimeDiff = DateDiff(EndDate, StartDate, 'hours')&lt;BR /&gt;return TimeDiff&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 15:08:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-integer-field-with-datediff/m-p/1388081#M79457</guid>
      <dc:creator>MikhaylaB</dc:creator>
      <dc:date>2024-02-28T15:08:33Z</dc:date>
    </item>
  </channel>
</rss>

