<?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: Combining a date and time field in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703753#M54478</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wonder if you could use&lt;A href="https://www.programiz.com/python-programming/datetime/strftime"&gt; strftime&lt;/A&gt;() to convert your date field to a string, and then merge with your string time field, and then use &lt;A href="https://www.journaldev.com/23365/python-string-to-datetime-strptime"&gt;strptime()&lt;/A&gt;&amp;nbsp;to convert that whole mess back to a real live date/time value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you really using shapefiles?&amp;nbsp; I thought the dbf of a shapefile didn't support a date field...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Dec 2019 23:02:33 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2019-12-10T23:02:33Z</dc:date>
    <item>
      <title>Combining a date and time field</title>
      <link>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703749#M54474</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;I have a point shapefile with a date field, called "Date" which is a Date type field.&amp;nbsp; And I have a time field, called "Time" which is in a String format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I combine these to allow me to enable the use of time for the shapefile?&amp;nbsp; The only solutions I have found are if these field are both in string format, but I am not sure how to convert the date field to string, using [Date].AsString didn't seem to work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone can help that would be amazing, if possible please be very specific in your response as I am quite a beginner at this sort of stuff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2019 10:04:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703749#M54474</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-12-09T10:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Combining a date and time field</title>
      <link>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703750#M54475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you elaborate on:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;using [Date].AsString didn't seem to work&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Did you get an error?&amp;nbsp; If so, what?&amp;nbsp; Or, were the result just unexpected, and what did you expect?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2019 16:48:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703750#M54475</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-12-09T16:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Combining a date and time field</title>
      <link>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703751#M54476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I had found a possible solution but both fields had to be in String format, so was attempting to convert the Date field to a String field.&amp;nbsp; That's it really, error as follows&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/475689_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2019 17:13:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703751#M54476</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-12-09T17:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Combining a date and time field</title>
      <link>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703752#M54477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where did you get "AsString", here &lt;A class="link-titled" href="https://support.esri.com/en/technical-article/000002292" title="https://support.esri.com/en/technical-article/000002292"&gt;How To: Convert a number field to a string field&lt;/A&gt; ?&amp;nbsp; AsString is not a valid VB or Python function/method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you use Python, but if you are set on using VB, then take a look at &lt;A class="link-titled" href="https://stackoverflow.com/questions/6792119/vbscript-convert-date-to-string" title="https://stackoverflow.com/questions/6792119/vbscript-convert-date-to-string"&gt;VBScript convert date to string - Stack Overflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2019 22:49:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703752#M54477</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-12-10T22:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Combining a date and time field</title>
      <link>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703753#M54478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wonder if you could use&lt;A href="https://www.programiz.com/python-programming/datetime/strftime"&gt; strftime&lt;/A&gt;() to convert your date field to a string, and then merge with your string time field, and then use &lt;A href="https://www.journaldev.com/23365/python-string-to-datetime-strptime"&gt;strptime()&lt;/A&gt;&amp;nbsp;to convert that whole mess back to a real live date/time value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you really using shapefiles?&amp;nbsp; I thought the dbf of a shapefile didn't support a date field...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2019 23:02:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703753#M54478</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-12-10T23:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Combining a date and time field</title>
      <link>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703754#M54479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joe, the current dBASE file format supports a timestamp field:&amp;nbsp; &lt;A class="link-titled" href="https://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm" title="https://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm"&gt;dBASE .DBF File Structure&lt;/A&gt;.&amp;nbsp; That said, timestamp is new in version 7 (&lt;A class="link-titled" href="http://www.dbase.com/Knowledgebase/dbulletin/bu12ce02.htm" title="http://www.dbase.com/Knowledgebase/dbulletin/bu12ce02.htm"&gt;Beginners&amp;#146; Corner (Part 2) - The dBASE Tables&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000000; font-family: Georgia, Arial, Helvetica; "&gt;&lt;SPAN&gt;* Timestamp&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000; font-family: Georgia, Arial, Helvetica; "&gt;New since Visual dBASE 7,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Timestamp&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;fields have a fixed width of eight bytes and are used to store the date and time of a precise moment. Note: The time precision extends to the second.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;UL style="color: #000000; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial;"&gt;&amp;nbsp;&lt;/UL&gt;&lt;P&gt;Esri's shapefile is based on dBASE III, which does not include a timestamp field, but a date field is supported.&amp;nbsp; So, you can store dates but not times.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2019 00:24:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703754#M54479</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-12-11T00:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Combining a date and time field</title>
      <link>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703755#M54480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just goes to show how often I use shape files. Years a go I responded to a post on the old forum that a friend had made.&amp;nbsp; I don't remember the exact subject, but it involed shape files. With tongue firmly planted in cheek, I posted a comment to him saying 'You know Bob, shape files are now illegal in 14 states....'&amp;nbsp; Holy cow, the frantic comments that followed...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2019 13:33:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703755#M54480</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-12-11T13:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Combining a date and time field</title>
      <link>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703756#M54481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll give it a try.&amp;nbsp; Thanks.&amp;nbsp; I've created a shapefile from a csv I was given.&amp;nbsp; Apologies for my lack of knowledge, I only dip in and out of GIS work, what would you otherwise use instead of a shapefile?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2019 12:02:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703756#M54481</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-12-12T12:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Combining a date and time field</title>
      <link>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703757#M54482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use some flavor of geodatabase feature class.&amp;nbsp; Occasionally I'll export a feature class to a shape file, zip all the components up and email the zip file to a colleague. But in terms of day to day data analysis, feature classes only.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2019 12:24:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703757#M54482</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-12-12T12:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Combining a date and time field</title>
      <link>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703758#M54483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I always thought a geodatabase was essentially a folder, and shapefiles resided within! I shall try it out&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2019 12:28:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703758#M54483</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-12-12T12:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Combining a date and time field</title>
      <link>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703759#M54484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many times the term shapefile is used generically, if not incorrectly; hence my question as to whether or not you are truly using shapefiles. Windows explorer 'sees' a file geodatase as a folder, but it is truly a database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/geodatabases/what-is-a-geodatabase.htm" title="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/geodatabases/what-is-a-geodatabase.htm"&gt;What is a geodatabase?—ArcGIS Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/shapefiles/what-is-a-shapefile.htm" title="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/shapefiles/what-is-a-shapefile.htm"&gt;What is a shapefile?—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/labs/what-is-arcgis/" title="https://developers.arcgis.com/labs/what-is-arcgis/"&gt;What is ArcGIS? | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2019 13:09:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703759#M54484</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-12-12T13:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Combining a date and time field</title>
      <link>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703760#M54485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By way of a solution to my original question, here is what I did for anyone else who comes across this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I originally had a csv file, I used Access to ensure both the Date and Time fields were in string format, and exported as a text file.&amp;nbsp; I then imported the text file into Arc, and created a point feature class from the file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then created a new field (called DateTime), this new field type was 'Date'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, using the field calculator I combined the Date and Time fields in this new field using the following (Python parse):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;datetime.datetime.strptime("{} {}".format(!Date!, !Time!), "%d/%m/%Y %H:%M:%S")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2019 16:09:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703760#M54485</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-12-12T16:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Combining a date and time field</title>
      <link>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703761#M54486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The csv file represents what type of geometry? I suspect points. Or is it just a table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At any rate,&amp;nbsp;more suggested reading:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/get-started/create-points-from-a-table.htm" title="https://pro.arcgis.com/en/pro-app/get-started/create-points-from-a-table.htm"&gt;Create points from a table—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/conversion/table-to-table.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/conversion/table-to-table.htm"&gt;Table To Table—Conversion toolbox | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might be able to skip the Access step....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2019 17:07:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/combining-a-date-and-time-field/m-p/703761#M54486</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-12-12T17:07:06Z</dc:date>
    </item>
  </channel>
</rss>

