<?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: Preserving a MySql datetime field in Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83344#M6611</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a little more complicated that that:&amp;nbsp; these tables get geocoded, and work their way into a published service which is then consumed by an Operations Dashboard app.&amp;nbsp; Ultimately, it's in OD where I need to filter by date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Feb 2020 16:28:31 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2020-02-13T16:28:31Z</dc:date>
    <item>
      <title>Preserving a MySql datetime field in Python</title>
      <link>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83340#M6607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a python script that extracts data from a MySql database and writes it to a csv.&amp;nbsp; The original table is a mix of all sorts of field types including datetime and timestamp.&amp;nbsp; Once the csv is written and I perform an an arcpy table to table to get it into a fgdb, the datetime fields automagically become text fields.&amp;nbsp; Not so good if you need to filter by date....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CSV files are both a boon and bane: is there a way to go right from MySql to a File geodatabse, thus preserving the field types?&amp;nbsp; Unfortunately I do not have admin rights to our e-gdb (Sql server back-end) so I can't go MySql to SqlServer....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 15:47:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83340#M6607</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-02-13T15:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Preserving a MySql datetime field in Python</title>
      <link>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83341#M6608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;s &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"2020-01-15 23:15:30"&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;# --- universal&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;datetime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;datetime&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;time&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;strptime&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;s&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"%Y-%m-%d %H:%M:%S"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="number token"&gt;2020&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;01&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;15&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;23&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;15&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;30&lt;/SPAN&gt;

t &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"01-15-2020 23:15:30"&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;# mon, day year&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;datetime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;datetime&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;time&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;strptime&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;t&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"%m-%d-%Y %H:%M:%S"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;2020&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;01&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;15&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;23&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;15&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;30&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;YYYY-MM-DD date format is it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:11:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83341#M6608</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-10T23:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Preserving a MySql datetime field in Python</title>
      <link>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83342#M6609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In mySql the values (when not Null) are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2019-07-08 10:59:11&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3241"&gt;Bruce Harold&lt;/A&gt;‌ provides:&amp;nbsp;&lt;A href="https://community.esri.com/community/open-platform-standards-and-interoperability/blog/2019/09/26/using-odbc-data-sources-in-core-arcgis-pro"&gt;https://community.esri.com/community/open-platform-standards-and-interoperability/blog/2019/09/26/using-odbc-data-sources-in-core-arcgis-pro&lt;/A&gt;&amp;nbsp; which discusses odbc connections:&amp;nbsp; my 64 bit windows 10 desktop has:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/482108_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the mySql site (&amp;nbsp;&lt;A class="link-titled" href="https://dev.mysql.com/downloads/connector/odbc/" title="https://dev.mysql.com/downloads/connector/odbc/"&gt;MySQL :: Download Connector/ODBC&lt;/A&gt;&amp;nbsp;) offers a 32 bit and a 64 bit driver.&amp;nbsp; So I'm a little confused as to which odbc driver to down load and for that matter how to use pyodbc to traverse it. (Installing pyodbc package as I type this...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 16:21:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83342#M6609</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-02-13T16:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Preserving a MySql datetime field in Python</title>
      <link>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83343#M6610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added to my post, YYYY-MM-DD is universal format great for sorting. If you need to parse by month, you can split on the string's - separator&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 16:24:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83343#M6610</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-02-13T16:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Preserving a MySql datetime field in Python</title>
      <link>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83344#M6611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a little more complicated that that:&amp;nbsp; these tables get geocoded, and work their way into a published service which is then consumed by an Operations Dashboard app.&amp;nbsp; Ultimately, it's in OD where I need to filter by date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 16:28:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83344#M6611</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-02-13T16:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Preserving a MySql datetime field in Python</title>
      <link>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83345#M6612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahhh sorry ... don't do the 'consumed' side of things &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 16:33:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83345#M6612</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-02-13T16:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Preserving a MySql datetime field in Python</title>
      <link>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83346#M6613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was afraid of losing you&amp;nbsp;with that point!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As mentioned, I'm adding the pydobc package through the ArcGIS Python Package Manager, and its still running, which if you notice my post regarding that is about at an hour.&amp;nbsp; Something is quite right there.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 16:43:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83346#M6613</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-02-13T16:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Preserving a MySql datetime field in Python</title>
      <link>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83347#M6614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All, this pain is totally avoidable, just obtain the Data Interoperability extension and go directly from MySQL to File GDB.&amp;nbsp; In Data Interop the reader is called MariaDB, in fact there are two, one spatial, one not.&amp;nbsp; Bouncing data through CSV will throw the schema overboard as even writing a schema.ini file can't handle all data types.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Feb 2020 17:00:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83347#M6614</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2020-02-14T17:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Preserving a MySql datetime field in Python</title>
      <link>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83348#M6615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.esri.com/migrated-users/3241"&gt;Bruce Harold&lt;/A&gt;!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Feb 2020 17:03:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83348#M6615</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-02-14T17:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Preserving a MySql datetime field in Python</title>
      <link>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83349#M6616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK full disclosure I'm the Product Manager for Data Interoperability &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Feb 2020 17:07:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83349#M6616</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2020-02-14T17:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Preserving a MySql datetime field in Python</title>
      <link>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83350#M6617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've got a couple of humongous databases to plow through.&amp;nbsp; It just might save not only time, but my sanity!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Feb 2020 17:16:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83350#M6617</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-02-14T17:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Preserving a MySql datetime field in Python</title>
      <link>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83351#M6618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/3241"&gt;Bruce Harold&lt;/A&gt;&amp;nbsp; &amp;nbsp;I just went to the &lt;A href="https://www.esri.com/en-us/arcgis/products/arcgis-data-interoperability/overview"&gt;ArcGIS Interoperabilty page&lt;/A&gt;, clicked on the Learn More link and it sent me to an &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/A_quick_tour_of_the_ArcGIS_Data_Interoperability_extension_for_Desktop/004m00000003000000/"&gt;ArcGIS Help 10.2, 20.21, and 10.2.2 page....&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Feb 2020 18:28:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83351#M6618</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-02-14T18:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Preserving a MySql datetime field in Python</title>
      <link>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83352#M6619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh my word, a doc bug!&amp;nbsp; Thanks for reporting it, I'll send it on.&lt;/P&gt;&lt;P&gt;Data Interoperability is an extension like Network Analyst, Spatial Analyst etc., you can evaluate it at no cost.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Feb 2020 18:53:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/preserving-a-mysql-datetime-field-in-python/m-p/83352#M6619</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2020-02-14T18:53:06Z</dc:date>
    </item>
  </channel>
</rss>

