<?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 Arcpy ValueError: unconverted data remains: PM in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74824#M6111</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This script works fine :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;import time&lt;BR /&gt;from datetime import datetime&lt;/P&gt;&lt;P&gt;date_string = '2009-11-29 03:17 PM'&lt;BR /&gt;format = '%Y-%m-%d %I:%M %p'&lt;BR /&gt;format2 = '%m/%d/%Y %I:%M:%S %p'&lt;BR /&gt;my_date = datetime.strptime(date_string, format)&lt;BR /&gt;print my_date.strftime(format2)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Result :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;11/29/2009 03:17:00 PM&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But If I have "import arcpy", it doesn't work !!&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;STRONG&gt;import arcpy&lt;/STRONG&gt;&lt;BR /&gt;import time&lt;BR /&gt;from datetime import datetime&lt;/P&gt;&lt;P&gt;date_string = '2009-11-29 03:17 PM'&lt;BR /&gt;format = '%Y-%m-%d %I:%M %p'&lt;BR /&gt;format2 = '%m/%d/%Y %I:%M:%S %p'&lt;BR /&gt;my_date = datetime.strptime(date_string, format)&lt;BR /&gt;print my_date.strftime(format2)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "E:\Scripts\1-Scripts\tests\ampm.py", line 40, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_date = datetime.strptime(date_string, format)&lt;BR /&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\_strptime.py", line 328, in _strptime&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data_string[found.end():])&lt;BR /&gt;ValueError: unconverted data remains: PM&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script needs arcpy, how to do the stuff without error ?&lt;/P&gt;&lt;P&gt;Thanks for help !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Nov 2016 08:38:42 GMT</pubDate>
    <dc:creator>MagalyClément-Zaber</dc:creator>
    <dc:date>2016-11-23T08:38:42Z</dc:date>
    <item>
      <title>Arcpy ValueError: unconverted data remains: PM</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74824#M6111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This script works fine :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;import time&lt;BR /&gt;from datetime import datetime&lt;/P&gt;&lt;P&gt;date_string = '2009-11-29 03:17 PM'&lt;BR /&gt;format = '%Y-%m-%d %I:%M %p'&lt;BR /&gt;format2 = '%m/%d/%Y %I:%M:%S %p'&lt;BR /&gt;my_date = datetime.strptime(date_string, format)&lt;BR /&gt;print my_date.strftime(format2)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Result :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;11/29/2009 03:17:00 PM&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But If I have "import arcpy", it doesn't work !!&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;STRONG&gt;import arcpy&lt;/STRONG&gt;&lt;BR /&gt;import time&lt;BR /&gt;from datetime import datetime&lt;/P&gt;&lt;P&gt;date_string = '2009-11-29 03:17 PM'&lt;BR /&gt;format = '%Y-%m-%d %I:%M %p'&lt;BR /&gt;format2 = '%m/%d/%Y %I:%M:%S %p'&lt;BR /&gt;my_date = datetime.strptime(date_string, format)&lt;BR /&gt;print my_date.strftime(format2)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "E:\Scripts\1-Scripts\tests\ampm.py", line 40, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_date = datetime.strptime(date_string, format)&lt;BR /&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\_strptime.py", line 328, in _strptime&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data_string[found.end():])&lt;BR /&gt;ValueError: unconverted data remains: PM&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script needs arcpy, how to do the stuff without error ?&lt;/P&gt;&lt;P&gt;Thanks for help !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 08:38:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74824#M6111</guid>
      <dc:creator>MagalyClément-Zaber</dc:creator>
      <dc:date>2016-11-23T08:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy ValueError: unconverted data remains: PM</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74825#M6112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, format is a keyword builtin. Its a method you can apply to strings to format them.&lt;/P&gt;&lt;P&gt;You are replacing this with your&amp;nbsp;"format time string".&lt;/P&gt;&lt;P&gt;What do you want to do? Make a fixed time format string == your date_string,&lt;/P&gt;&lt;P&gt;or,&lt;/P&gt;&lt;P&gt;set a variable to the current time &amp;amp; date?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 11:25:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74825#M6112</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2016-11-23T11:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy ValueError: unconverted data remains: PM</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74826#M6113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have dates in string format and have to put in database in a datime format.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;date_string = '11/29/2019 03:17 PM'&lt;BR /&gt;print date_string&lt;BR /&gt;format1 = '%m/%d/%Y %I:%M %p'&lt;BR /&gt;format2 = '%Y-%m-%d %I:%M:%S'&lt;BR /&gt;my_date = datetime.strptime(date_string, format1)&lt;BR /&gt;print my_date.strftime(format2)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Works fine without "import arcpy"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found another way :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ## self.lastUsageDate = '11/29/2019 03:17 PM'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp = self.lastUsageDate.split(" ")&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format12 = '%I:%M:%S'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format24 = '%H:%M:%S'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_hour = datetime.strptime(tmp[1], format12)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (tmp[2] == "PM"):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_hour += timedelta(hours=12)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; formatDate = '%m/%d/%Y'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; formatDateBase = '%Y-%m-%d'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_date = datetime.strptime(tmp[0], formatDate)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return my_date.strftime(formatDateBase) + " " + my_hour.strftime(format24)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 12:32:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74826#M6113</guid>
      <dc:creator>MagalyClément-Zaber</dc:creator>
      <dc:date>2016-11-23T12:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy ValueError: unconverted data remains: PM</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74827#M6114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something else is going on, either with additional code you haven't provided or how this "script" is being called.&amp;nbsp;&amp;nbsp; I executed the code, including &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;import arcpy&lt;/SPAN&gt;, on two separate machines with two different versions of ArcGIS for Desktop, and everything ran fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does the script only include the code you have provided?&amp;nbsp; If so, how are you calling the script?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 14:31:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74827#M6114</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-11-23T14:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy ValueError: unconverted data remains: PM</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74828#M6115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use PyScripter to call the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I put the minimun to test :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;#-*- coding: utf-8 -*-&lt;BR /&gt;##import arcpy&lt;BR /&gt;from datetime import datetime&lt;BR /&gt;&lt;BR /&gt;date_string = '11/29/2019 03:17 PM'&lt;BR /&gt;print date_string&lt;BR /&gt;format1 = '%m/%d/%Y %I:%M %p'&lt;BR /&gt;format2 = '%Y-%m-%d %I:%M:%S'&lt;BR /&gt;my_date = datetime.strptime(date_string, format1)&lt;BR /&gt;print my_date.strftime(format2)&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 14:42:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74828#M6115</guid>
      <dc:creator>MagalyClément-Zaber</dc:creator>
      <dc:date>2016-11-23T14:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy ValueError: unconverted data remains: PM</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74829#M6116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't use PyScripter nor have it installed on any machines.&amp;nbsp; When I take the code and run it as a script file directly from the ArcGIS-bundled Python interpreter, it works fine with and without the ArcPy import statement.&amp;nbsp; I am not sure what might be going on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 18:48:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74829#M6116</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-11-23T18:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy ValueError: unconverted data remains: PM</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74830#M6117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is unfortunately a namespace collision in ArcPy from the early days of its design. See&amp;nbsp;&lt;A href="https://community.esri.com/thread/179836"&gt;import arcpy tramples datetime import&lt;/A&gt;&amp;nbsp;for more info.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;As a workaround you can use:&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="" style="background-color: #fbfbfb; border: 0px; font-size: 12px; margin: 0px !important; padding: 1px 0px 0px;"&gt;&lt;DIV class="" style="border: 0px; font-weight: inherit; font-size: 12px; padding: 0px 0px 0px 45px;"&gt;&lt;DIV style="border: 0px; font-weight: inherit; font-size: 12px;"&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;OL class="" start="1" style="color: #5c5c5c; background-color: #ffffff; border: none; font-weight: inherit; font-size: 12px; margin: 0px 0px 1px 45px !important;"&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; font-weight: inherit; font-size: 12px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;&lt;SPAN class="" style="color: #0088e1; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;import&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;&amp;nbsp;datetime&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f6f6f6; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; font-weight: inherit; font-size: 12px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;datetime.datetime.now()&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; font-weight: inherit; font-size: 12px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;&lt;SPAN class="" style="color: #0088e1; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;import&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;&amp;nbsp;arcpy&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f6f6f6; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; font-weight: inherit; font-size: 12px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;datetime.datetime.now()&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Or alternatively:&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="" style="background-color: #fbfbfb; border: 0px; font-size: 12px; margin: 0px !important; padding: 1px 0px 0px;"&gt;&lt;DIV class="" style="border: 0px; font-weight: inherit; font-size: 12px; padding: 0px 0px 0px 45px;"&gt;&lt;DIV style="border: 0px; font-weight: inherit; font-size: 12px;"&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;OL class="" start="1" style="color: #5c5c5c; background-color: #ffffff; border: none; font-weight: inherit; font-size: 12px; margin: 0px 0px 1px 45px !important;"&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; font-weight: inherit; font-size: 12px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;&lt;SPAN class="" style="color: #0088e1; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;&amp;nbsp;datetime&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0088e1; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;import&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;&amp;nbsp;datetime&amp;nbsp;as&amp;nbsp;dt&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f6f6f6; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; font-weight: inherit; font-size: 12px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;dt.now()&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; font-weight: inherit; font-size: 12px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;&lt;SPAN class="" style="color: #0088e1; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;import&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;&amp;nbsp;arcpy&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f6f6f6; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; font-weight: inherit; font-size: 12px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;dt.now()&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 19:38:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74830#M6117</guid>
      <dc:creator>ClintonDow1</dc:creator>
      <dc:date>2016-11-23T19:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy ValueError: unconverted data remains: PM</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74831#M6118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had this problem too!. Although I never knew the cause, I found that just importing datetime (your first example) worked for me. Good to know the second option is viable too. Thanks &lt;A href="https://community.esri.com/people/CDow-esristaff"&gt;CDow-esristaff&lt;/A&gt;‌!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 19:57:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74831#M6118</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2016-11-23T19:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy ValueError: unconverted data remains: PM</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74832#M6119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is best to import standard modules first and in the order of their &amp;nbsp; importance. &amp;nbsp;Arcpy is not a primary module, other examples include SciPy, Pandas and NumPy which all import bits of the standards as well as bits of one another sometimes. &amp;nbsp;If you need the most current and relevant ... ordering your imports is important, since once imported, it is skipped on future attempts unless expressly done... which requires effort.&lt;/P&gt;&lt;P&gt;Check it out yourself, even the os modules tries to import sys.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 20:25:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-valueerror-unconverted-data-remains-pm/m-p/74832#M6119</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-11-23T20:25:54Z</dc:date>
    </item>
  </channel>
</rss>

