<?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: Field of type date being interpreted as a string in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/field-of-type-date-being-interpreted-as-a-string/m-p/1485133#M70721</link>
    <description>&lt;P&gt;In field calculator your python expression would be something like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;int(str(datetime.today() - !LastInsp!).split(" ")[0])&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 05 Jun 2024 09:21:22 GMT</pubDate>
    <dc:creator>RichardHowe</dc:creator>
    <dc:date>2024-06-05T09:21:22Z</dc:date>
    <item>
      <title>Field of type date being interpreted as a string</title>
      <link>https://community.esri.com/t5/python-questions/field-of-type-date-being-interpreted-as-a-string/m-p/1484719#M70718</link>
      <description>&lt;P&gt;I have a feature class in which I'm trying to calculate the number of days between now, and when a property was last inspected. However, when I try to use the variable for the last inspection date Python/arcgis seems to think LastInsp is a string - but its a date field. I'm baffled, I use a hosted version of this featureclass, and use Arcade to calculate this value using this approach which works fine.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var last_date = $feature.LastInsp;
var now = Today();
var DaysSince = round(DateDiff(now,last_date,'days'))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2024 19:44:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-of-type-date-being-interpreted-as-a-string/m-p/1484719#M70718</guid>
      <dc:creator>clt_cabq</dc:creator>
      <dc:date>2024-06-04T19:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Field of type date being interpreted as a string</title>
      <link>https://community.esri.com/t5/python-questions/field-of-type-date-being-interpreted-as-a-string/m-p/1485133#M70721</link>
      <description>&lt;P&gt;In field calculator your python expression would be something like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;int(str(datetime.today() - !LastInsp!).split(" ")[0])&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 05 Jun 2024 09:21:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-of-type-date-being-interpreted-as-a-string/m-p/1485133#M70721</guid>
      <dc:creator>RichardHowe</dc:creator>
      <dc:date>2024-06-05T09:21:22Z</dc:date>
    </item>
  </channel>
</rss>

