<?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: Convert Time Field in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/convert-time-field/m-p/14025#M1099</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just a word of warning In a file geodatabase the date and times are all stored as unicode strings, and you need to specify that when manipulating them with Python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;nbsp; time_value.encode('utf-8'), "%d/%m/%Y %I:%M:%S %p") &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Feb 2014 02:04:30 GMT</pubDate>
    <dc:creator>TimothyElliott</dc:creator>
    <dc:date>2014-02-10T02:04:30Z</dc:date>
    <item>
      <title>Convert Time Field</title>
      <link>https://community.esri.com/t5/python-questions/convert-time-field/m-p/14022#M1096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This tool seems very strait forward but is causing issues when put into python. Works fine in ArcMap and I get the expected results.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My Input Time Field(Text Field) looks like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2014-02-01 02:11 AM&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;inputTimeField = "Incident_Date___Time"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;inputTimeFormat = "1033;yyyy-MM-dd HH:mm tt"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outputDateField = "IncDateTime"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.ConvertTimeField_management("myFGDB",inputTimeField,inputTimeFormat,outputDateField)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.DeleteField_management(blot,"DateTime")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After the tool is run the IncDateTime Field comes back as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1/1/2001&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I missing something here?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 11:10:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-time-field/m-p/14022#M1096</guid>
      <dc:creator>AdamBeard</dc:creator>
      <dc:date>2014-02-07T11:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Time Field</title>
      <link>https://community.esri.com/t5/python-questions/convert-time-field/m-p/14023#M1097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Adam,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A good trick to get the syntax correct is to run the tool in ArcMap, then open the Results window (Geoprocessing menu &amp;gt; Results).&amp;nbsp; Right-click on the completed tool &amp;gt; Copy As Python Snippet.&amp;nbsp; You can then paste this into your script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 12:17:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-time-field/m-p/14023#M1097</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2014-02-07T12:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Time Field</title>
      <link>https://community.esri.com/t5/python-questions/convert-time-field/m-p/14024#M1098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would suggest looking at the python datetime module.&amp;nbsp; It will do anything you can think of for manipulating date and time values.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 19:58:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-time-field/m-p/14024#M1098</guid>
      <dc:creator>David_JAnderson</dc:creator>
      <dc:date>2014-02-07T19:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Time Field</title>
      <link>https://community.esri.com/t5/python-questions/convert-time-field/m-p/14025#M1099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just a word of warning In a file geodatabase the date and times are all stored as unicode strings, and you need to specify that when manipulating them with Python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;nbsp; time_value.encode('utf-8'), "%d/%m/%Y %I:%M:%S %p") &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 02:04:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-time-field/m-p/14025#M1099</guid>
      <dc:creator>TimothyElliott</dc:creator>
      <dc:date>2014-02-10T02:04:30Z</dc:date>
    </item>
  </channel>
</rss>

