<?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: Labeling with Dates in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/labeling-with-dates/m-p/656386#M51089</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good day Nicholas,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As far as I know arcmap stores only date objects (without time). For this reason, I suspect the DateOff is a string field (which is why you're using the array on it).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If there is a space in between the year and the time, you can split your string using that space and take the first part (see below).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You may also want to use &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;"/n"&lt;/SPAN&gt;&lt;SPAN&gt; instead of &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;os.linesep&lt;/SPAN&gt;&lt;SPAN&gt; (at your discretion). &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;def FindLabel ( [Cause_Of_Outage] , [Date_Off] ): &amp;nbsp; outageType = [Cause_Of_Outage]&amp;nbsp; &amp;nbsp; dateOff = [Date_Off].split(" ")[0] &amp;nbsp; return 'Outage Type: ' + outageType + '\nDate Off: ' + dateOff&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck, hope it works out!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Jan 2014 19:05:49 GMT</pubDate>
    <dc:creator>JoshuaChisholm</dc:creator>
    <dc:date>2014-01-21T19:05:49Z</dc:date>
    <item>
      <title>Labeling with Dates</title>
      <link>https://community.esri.com/t5/python-questions/labeling-with-dates/m-p/656385#M51088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to label a feature class that has a date field in it. My problem is that I only want to get the mm/dd/yyyy, but when I try to label it through python it will bring up the time as well. I tried using an array on dateOff (the date field), but I still run into the issue of it grabbing part of the time. My question is, what do I need to do in my python script to only get the date information and not the time information to show up in my label.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a sample of what I have done so far.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import os&amp;nbsp; def FindLabel ( [Cause_Of_Outage] , [Date_Off] ): &amp;nbsp; outageType = [Cause_Of_Outage]&amp;nbsp; &amp;nbsp; dateOff = [Date_Off]&amp;nbsp; &amp;nbsp; return 'Outage Type: ' + outageType + os.linesep +'Date Off: ' + dateOff[0:10]&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jan 2014 18:29:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/labeling-with-dates/m-p/656385#M51088</guid>
      <dc:creator>NicholasGlover</dc:creator>
      <dc:date>2014-01-21T18:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling with Dates</title>
      <link>https://community.esri.com/t5/python-questions/labeling-with-dates/m-p/656386#M51089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good day Nicholas,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As far as I know arcmap stores only date objects (without time). For this reason, I suspect the DateOff is a string field (which is why you're using the array on it).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If there is a space in between the year and the time, you can split your string using that space and take the first part (see below).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You may also want to use &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;"/n"&lt;/SPAN&gt;&lt;SPAN&gt; instead of &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;os.linesep&lt;/SPAN&gt;&lt;SPAN&gt; (at your discretion). &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;def FindLabel ( [Cause_Of_Outage] , [Date_Off] ): &amp;nbsp; outageType = [Cause_Of_Outage]&amp;nbsp; &amp;nbsp; dateOff = [Date_Off].split(" ")[0] &amp;nbsp; return 'Outage Type: ' + outageType + '\nDate Off: ' + dateOff&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck, hope it works out!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jan 2014 19:05:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/labeling-with-dates/m-p/656386#M51089</guid>
      <dc:creator>JoshuaChisholm</dc:creator>
      <dc:date>2014-01-21T19:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling with Dates</title>
      <link>https://community.esri.com/t5/python-questions/labeling-with-dates/m-p/656387#M51090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That seemed to do it Joshua! Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jan 2014 19:29:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/labeling-with-dates/m-p/656387#M51090</guid>
      <dc:creator>NicholasGlover</dc:creator>
      <dc:date>2014-01-21T19:29:32Z</dc:date>
    </item>
  </channel>
</rss>

