<?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: Using Arcade to format date for feature? in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-format-date-for-feature/m-p/1592936#M63926</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/712076"&gt;@CodyPatterson&lt;/a&gt;&amp;nbsp;has the right method but I am simply putting this one out there to show a simpler way of writing the same code.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Option A
var D = $feature.Incorporation_Date
iif( !IsEmpty( D ) , "Incorporated on " + Text(D, "MMMM D, YYYY") + " (" + $feature.Incorporation_Citation + ")" , Null )

// Option B
var N = Null
if( !IsEmpty( $feature.Incorporation_Date ) ){ N = "Incorporated on " + Text($feature.Incorporation_Date, "MMMM D, YYYY") + " (" + $feature.Incorporation_Citation + ")" }
return N&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 06 Mar 2025 19:01:40 GMT</pubDate>
    <dc:creator>RPGIS</dc:creator>
    <dc:date>2025-03-06T19:01:40Z</dc:date>
    <item>
      <title>Using Arcade to format date for feature?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-format-date-for-feature/m-p/1592917#M63923</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a feature (Incorporation_Date) that, in ArcGIS pro, I set to format 'Month D, YYYY' like the other date columns in my dataset. There are only two map points with this feature, so I use the following expression:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;IsEmpty&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Incorporation_Date&lt;/SPAN&gt;&lt;SPAN&gt;)) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;null&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;else&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;SPAN&gt;"Incorporated on "&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Incorporation_Date&lt;/SPAN&gt;&lt;SPAN&gt;) + &lt;/SPAN&gt;&lt;SPAN&gt;" ("&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Incorporation_Citation&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;")"&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;However, the expression returns the date formatted as YYYY-MM-DD 00:00:00. I attempted to add Text(DateOnly before) the feature to remove the time section, but would like to know how to re-format the date to Month D, YYYY.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Mar 2025 18:36:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-format-date-for-feature/m-p/1592917#M63923</guid>
      <dc:creator>BaileyDeSimone</dc:creator>
      <dc:date>2025-03-06T18:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arcade to format date for feature?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-format-date-for-feature/m-p/1592920#M63924</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/766048"&gt;@BaileyDeSimone&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From what I'm seeing you're pretty close! Give this a shot here:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (IsEmpty($feature.Incorporation_Date)) {
  return null;
} else {
  return "Incorporated on " + Text($feature.Incorporation_Date, "MMMM D, YYYY") + " (" + $feature.Incorporation_Citation + ")";
}&lt;/LI-CODE&gt;&lt;P&gt;This uses the same Text feature, but assigns the format of the MMMM D YYYY, I think MMMM is the right format for this case!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 18:44:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-format-date-for-feature/m-p/1592920#M63924</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2025-03-06T18:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arcade to format date for feature?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-format-date-for-feature/m-p/1592936#M63926</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/712076"&gt;@CodyPatterson&lt;/a&gt;&amp;nbsp;has the right method but I am simply putting this one out there to show a simpler way of writing the same code.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Option A
var D = $feature.Incorporation_Date
iif( !IsEmpty( D ) , "Incorporated on " + Text(D, "MMMM D, YYYY") + " (" + $feature.Incorporation_Citation + ")" , Null )

// Option B
var N = Null
if( !IsEmpty( $feature.Incorporation_Date ) ){ N = "Incorporated on " + Text($feature.Incorporation_Date, "MMMM D, YYYY") + " (" + $feature.Incorporation_Citation + ")" }
return N&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 06 Mar 2025 19:01:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-format-date-for-feature/m-p/1592936#M63926</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2025-03-06T19:01:40Z</dc:date>
    </item>
  </channel>
</rss>

