<?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: AGOL Date fields how to convert them to strings in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-date-fields-how-to-convert-them-to-strings/m-p/1564811#M10928</link>
    <description>&lt;P&gt;You can pass a date/time value directly into a method like edit_features or you can pass a timestamp in the same format that the query returned it in.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2024 18:29:23 GMT</pubDate>
    <dc:creator>MobiusSnake</dc:creator>
    <dc:date>2024-12-04T18:29:23Z</dc:date>
    <item>
      <title>AGOL Date fields how to convert them to strings</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-date-fields-how-to-convert-them-to-strings/m-p/1564663#M10924</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;date fields when I read a recorrd froma hosted layer in AGOL have nummeric values:&lt;/P&gt;&lt;P&gt;this is the value for this field: "created_date": 1719488318485&lt;/P&gt;&lt;P&gt;Python:&lt;/P&gt;&lt;P&gt;record = query_result1.features[0]&lt;BR /&gt;createddateAGOL = record.attributes["created_date"]&lt;/P&gt;&lt;P&gt;How do I convert this numeric value to a data that I can compare with a record from a SDE feature&amp;nbsp; class&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&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, 04 Dec 2024 15:10:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-date-fields-how-to-convert-them-to-strings/m-p/1564663#M10924</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2024-12-04T15:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: AGOL Date fields how to convert them to strings</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-date-fields-how-to-convert-them-to-strings/m-p/1564698#M10925</link>
      <description>&lt;P&gt;Use this to convert to a date/time object:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from datetime import datetime as dt

created_date = record.attributes["created_date"]
my_dt = dt.utcfromtimestamp(created_date / 1000)&lt;/LI-CODE&gt;&lt;P&gt;From there, there are various date/time formatting options:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.python.org/3/library/datetime.html#format-codes" target="_blank"&gt;https://docs.python.org/3/library/datetime.html#format-codes&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 15:41:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-date-fields-how-to-convert-them-to-strings/m-p/1564698#M10925</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2024-12-04T15:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: AGOL Date fields how to convert them to strings</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-date-fields-how-to-convert-them-to-strings/m-p/1564797#M10927</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/115587"&gt;@MobiusSnake&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I store a datetme object&amp;nbsp; value in a date field from a hosted feature layer?&lt;/P&gt;&lt;P&gt;I am updating the value of a date field in a hosted feature layer using Python.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 18:15:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-date-fields-how-to-convert-them-to-strings/m-p/1564797#M10927</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2024-12-04T18:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: AGOL Date fields how to convert them to strings</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-date-fields-how-to-convert-them-to-strings/m-p/1564811#M10928</link>
      <description>&lt;P&gt;You can pass a date/time value directly into a method like edit_features or you can pass a timestamp in the same format that the query returned it in.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 18:29:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/agol-date-fields-how-to-convert-them-to-strings/m-p/1564811#M10928</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2024-12-04T18:29:23Z</dc:date>
    </item>
  </channel>
</rss>

