<?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: Arcade Second() Function Cutting Off Leading Zero in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650684#M4420</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used this&amp;nbsp;&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold; font-size: 14px;"&gt;Text(EndTime, 'mm:ss')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Sep 2019 17:28:08 GMT</pubDate>
    <dc:creator>LeviCecil</dc:creator>
    <dc:date>2019-09-13T17:28:08Z</dc:date>
    <item>
      <title>Arcade Second() Function Cutting Off Leading Zero</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650680#M4416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I'm calculating total drive times in Network Analyst. I have an end time field that I'm trying to strip the minutes and seconds from for a new field. It's a date field formatted like so:&amp;nbsp;9/16/2019 8:01:06 AM. I enter&lt;STRONG&gt; Minute(EndTime) + ":" + Second(EndTime)&amp;nbsp;&lt;/STRONG&gt;in the field calculator. The issue is, I'm getting resulting times like&amp;nbsp;&lt;STRONG&gt;1:6&lt;/STRONG&gt; which should read&amp;nbsp;&lt;STRONG&gt;1:06&lt;/STRONG&gt;, or one minute, six seconds. What gives??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 21:32:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650680#M4416</guid>
      <dc:creator>LeviCecil</dc:creator>
      <dc:date>2019-09-12T21:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Second() Function Cutting Off Leading Zero</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650681#M4417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/372117"&gt;Levi Cecil&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the following: &lt;STRONG&gt;Text(EndTime, 'm:ss')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 00:55:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650681#M4417</guid>
      <dc:creator>LanceCole</dc:creator>
      <dc:date>2019-09-13T00:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Second() Function Cutting Off Leading Zero</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650682#M4418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/372117"&gt;Levi Cecil&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition to the correct answer provided by&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/67060"&gt;Lance Cole&lt;/A&gt;&amp;nbsp;, it is important to understand that the Second function returns a number, not a text:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;H5 style="color: #4c4c4c; background-color: #ffffff; font-size: 1.2019rem; margin: 0px 0px 0.75rem;"&gt;Second( dateValue ) -&amp;gt; returns:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE style="color: #595959; background-color: #f8f8f8; border: 1px solid #efefef; font-size: 0.875em;"&gt;Number&lt;/CODE&gt;&lt;/H5&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;See:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/arcade/function-reference/date_functions/#second" title="https://developers.arcgis.com/arcade/function-reference/date_functions/#second"&gt;Date Functions | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You want to get the result in a certain format and that is obtained by using the Text function as Lance described. In this case you don't have to use the Second and Minute functions, but by providing the desired format "m:ss" or "mm:ss" (what ever suits your need most) you can use a single function. To see more formatting options, please see:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/arcade/function-reference/data_functions/#text" title="https://developers.arcgis.com/arcade/function-reference/data_functions/#text"&gt;Data Functions | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 15:39:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650682#M4418</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-09-13T15:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Second() Function Cutting Off Leading Zero</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650683#M4419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Xander. This works, but only for times over one minute (see screenshot).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/459451_timecalc.PNG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 16:44:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650683#M4419</guid>
      <dc:creator>LeviCecil</dc:creator>
      <dc:date>2019-09-13T16:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Second() Function Cutting Off Leading Zero</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650684#M4420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used this&amp;nbsp;&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold; font-size: 14px;"&gt;Text(EndTime, 'mm:ss')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 17:28:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650684#M4420</guid>
      <dc:creator>LeviCecil</dc:creator>
      <dc:date>2019-09-13T17:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Second() Function Cutting Off Leading Zero</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650685#M4421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/372117"&gt;Levi Cecil&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested this in the playground here:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/arcade/playground/" title="https://developers.arcgis.com/arcade/playground/"&gt;ArcGIS Arcade | ArcGIS for Developers&lt;/A&gt;&amp;nbsp; and it works there if I define a date as the one you have:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="323" src="https://community.esri.com/legacyfs/online/459500_pastedImage_1.png" width="496" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I do the same in ArcGIS Pro:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" height="466" src="https://community.esri.com/legacyfs/online/459501_pastedImage_4.png" width="339" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It also seems to work:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" height="291" src="https://community.esri.com/legacyfs/online/459502_pastedImage_5.png" width="324" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure what is going wrong in your case...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 20:12:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650685#M4421</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-09-13T20:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Second() Function Cutting Off Leading Zero</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650686#M4422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added the extra 'm' to your original solution &lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold;"&gt;Text(EndTime, 'mm:ss')&lt;/STRONG&gt;.&amp;nbsp;A single 'm',&amp;nbsp;&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold;"&gt;Text(EndTime, 'm:ss')&amp;nbsp;&lt;/STRONG&gt;results in an empty string if the time is less than a minute.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 20:25:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-second-function-cutting-off-leading-zero/m-p/650686#M4422</guid>
      <dc:creator>LeviCecil</dc:creator>
      <dc:date>2019-09-13T20:25:20Z</dc:date>
    </item>
  </channel>
</rss>

