<?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 combining different date and time fields in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344804#M27035</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a rather unique problem.&amp;nbsp; Not sure if Python is the right way to solve it, but here goes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have some satellite (radiotelemetry) location data that I am trying to analyze for movement patterns, etc.&amp;nbsp; I want to animate certain time periods.&amp;nbsp; However because of the way the data are downloaded, I have a date field for the date but for the time, I had to make a text field and convert the time into the following format:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;hh:mm am/pm&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I need a singe field to make the animation work the way I want (showing consecutive locations on a map).&amp;nbsp; I'm not overly familiar with the datetime functions in Python.&amp;nbsp; Is there a way to combine these two fields into a single datetime field?&amp;nbsp; Would it be somehow easier to do this with the field calculator?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any suggestions.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Amy Meehan&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wildlife Biologist&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Maine Dept. Inland Fisheries and Wildlife&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Oct 2011 15:18:22 GMT</pubDate>
    <dc:creator>AmyMeehan</dc:creator>
    <dc:date>2011-10-12T15:18:22Z</dc:date>
    <item>
      <title>combining different date and time fields</title>
      <link>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344804#M27035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a rather unique problem.&amp;nbsp; Not sure if Python is the right way to solve it, but here goes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have some satellite (radiotelemetry) location data that I am trying to analyze for movement patterns, etc.&amp;nbsp; I want to animate certain time periods.&amp;nbsp; However because of the way the data are downloaded, I have a date field for the date but for the time, I had to make a text field and convert the time into the following format:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;hh:mm am/pm&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I need a singe field to make the animation work the way I want (showing consecutive locations on a map).&amp;nbsp; I'm not overly familiar with the datetime functions in Python.&amp;nbsp; Is there a way to combine these two fields into a single datetime field?&amp;nbsp; Would it be somehow easier to do this with the field calculator?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any suggestions.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Amy Meehan&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wildlife Biologist&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Maine Dept. Inland Fisheries and Wildlife&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 15:18:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344804#M27035</guid>
      <dc:creator>AmyMeehan</dc:creator>
      <dc:date>2011-10-12T15:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: combining different date and time fields</title>
      <link>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344805#M27036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Don't know much about "formal" methods of converting date/time formats in Python, but I think there are some built in converters: &lt;/SPAN&gt;&lt;A href="http://docs.python.org/library/time.html"&gt;http://docs.python.org/library/time.html&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I for one absolutely HATE all the different date/time formats that all the different databases use (Oracle vs. FGDB vs. DBF vs SQL vs...)! So one thing I always use (because it's simple) is to convert my disparate date/time fields to a simple long integer (or text) format of YYYYMMDDHHMMSS. So 20111012141239 would be 2:12:39PM on Oct 12, 2011. When reading from left to right, it is then very easy to then parse date/times.... Once everything is in a consistent format, then life is easy.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 20:42:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344805#M27036</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-10-12T20:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: combining different date and time fields</title>
      <link>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344806#M27037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Create a date field in your geodatabase (not shapefile) and populate it using the datetime object in Python. The datetime module handles all the messy calculations very well and the animation tools need a date field. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have the source data as&amp;nbsp; separate strings there are easy conversions to a datetime object using datetime.combine(date,time)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The datetime object also knows about time intervals, so you can subtract two dates to get the differences easily, or add useful offsets such as a week, month or year without worrying about days in the month or leap years.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;eg&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import datetime
print datetime.datetime.now()
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:14:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344806#M27037</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2021-12-11T16:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: combining different date and time fields</title>
      <link>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344807#M27038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Funny that:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import datetime
&amp;gt;&amp;gt;&amp;gt; datetime.datetime.now()
datetime.datetime(2011, 10, 12, 21, 8, 37, 327000)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Easy breeze...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the reminder about datetime Kim!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:14:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344807#M27038</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T16:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: combining different date and time fields</title>
      <link>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344808#M27039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you both!&amp;nbsp; I will try your suggestions!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Amy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 16:47:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344808#M27039</guid>
      <dc:creator>AmyMeehan</dc:creator>
      <dc:date>2011-10-13T16:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: combining different date and time fields</title>
      <link>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344809#M27040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I managed to get my data into the format Chris suggested and then the Convert to Time field tool actually worked.&amp;nbsp; Thank you!! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Amy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2011 13:34:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344809#M27040</guid>
      <dc:creator>AmyMeehan</dc:creator>
      <dc:date>2011-10-14T13:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: combining different date and time fields</title>
      <link>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344810#M27041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is an old thread but I'm going to take a shot. I need to create a date field from 3 separate numeric fields in my feature class - "yr", "mon", and "day", using python. I can not seem to figure this out. Any help is greatly appreciated! Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 18:30:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-different-date-and-time-fields/m-p/344810#M27041</guid>
      <dc:creator>deleted-user-IR249IovB3CN</dc:creator>
      <dc:date>2012-06-20T18:30:48Z</dc:date>
    </item>
  </channel>
</rss>

