<?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 Time Difference to decimal in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/time-difference-to-decimal/m-p/1547361#M89045</link>
    <description>&lt;P&gt;I am working with a File GDB Feature Class thru Field Calculate (Python or Arcade) and trying to figure out HOW to calculate the difference between the Start Time and End Time.&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Start Time: 7:00 AM&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;End Time: 2:15 PM&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Time Difference: 2.25&lt;/P&gt;&lt;P&gt;How do I go about doing this? My other research results in just a flat hour or minutes and cannot figure out how to convert to the actual decimal difference.&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2024 20:52:20 GMT</pubDate>
    <dc:creator>ModernElectric</dc:creator>
    <dc:date>2024-10-09T20:52:20Z</dc:date>
    <item>
      <title>Time Difference to decimal</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/time-difference-to-decimal/m-p/1547361#M89045</link>
      <description>&lt;P&gt;I am working with a File GDB Feature Class thru Field Calculate (Python or Arcade) and trying to figure out HOW to calculate the difference between the Start Time and End Time.&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Start Time: 7:00 AM&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;End Time: 2:15 PM&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Time Difference: 2.25&lt;/P&gt;&lt;P&gt;How do I go about doing this? My other research results in just a flat hour or minutes and cannot figure out how to convert to the actual decimal difference.&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 20:52:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/time-difference-to-decimal/m-p/1547361#M89045</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2024-10-09T20:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Time Difference to decimal</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/time-difference-to-decimal/m-p/1547633#M89068</link>
      <description>&lt;P&gt;If you have proper date fields in your data, they'll be converted into Python datetime objects when you run Calculate Field in Python3 mode. This means you can put something like this in your code block to get a decimal result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def run(start, end):
    diff = end - start  # creates datetime.TimeDelta object
    return diff.hours + (diff.minutes / 60.0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exercise for the reader: handle cases with null inputs.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 15:54:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/time-difference-to-decimal/m-p/1547633#M89068</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2024-10-10T15:54:38Z</dc:date>
    </item>
  </channel>
</rss>

