<?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: Attribute Rule - Year from Date &amp;amp; Time field in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142326#M51192</link>
    <description>&lt;P&gt;Your &lt;STRONG&gt;YEAR&lt;/STRONG&gt; field is a &lt;EM&gt;date field&lt;/EM&gt;, but the &lt;STRONG&gt;Year&lt;/STRONG&gt; function in Arcade returns a numeric value. In order to call something like &lt;STRONG&gt;Year(Now())&lt;/STRONG&gt; and get 2022 stored in your field, it needs to be a different type.&lt;/P&gt;&lt;P&gt;Since &lt;EM&gt;Date&lt;/EM&gt; fields are really just integers representing "milliseconds since &amp;lt;your DB's reference timestamp&amp;gt;", you'll probably end up with a bunch of values just a few seconds after midnight on that reference timestamp, the way your field is set up now.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Feb 2022 20:33:29 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2022-02-09T20:33:29Z</dc:date>
    <item>
      <title>Attribute Rule - Year from Date &amp; Time field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142315#M51190</link>
      <description>&lt;P&gt;Hello! (ArcGIS Pro 2.9.1)&lt;/P&gt;&lt;P&gt;I am trying to sort out what I am doing wrong with my attribute rule. This is my first time dabbling with it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two fields. One is a date and time field. This is filled by a survey. The Year field is where I want to apply an attribute field. I want it to only have the four digit year from the date and time field.&amp;nbsp; However, the year that is returning is 1899.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JessicaJThompson_0-1644437769392.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33538iA39DE09E65A72B63/image-size/large?v=v2&amp;amp;px=999" role="button" title="JessicaJThompson_0-1644437769392.png" alt="JessicaJThompson_0-1644437769392.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JessicaJThompson_1-1644437838208.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33539iF9DF6F3BCB2A534A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JessicaJThompson_1-1644437838208.png" alt="JessicaJThompson_1-1644437838208.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have tried a few variations in the expression but none are working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JessicaJThompson_2-1644438004038.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33540i485A277B26174E53/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JessicaJThompson_2-1644438004038.png" alt="JessicaJThompson_2-1644438004038.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your kind help to solve this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Jessica Thompson&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 20:20:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142315#M51190</guid>
      <dc:creator>JessicaJThompson</dc:creator>
      <dc:date>2022-02-09T20:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Year from Date &amp; Time field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142326#M51192</link>
      <description>&lt;P&gt;Your &lt;STRONG&gt;YEAR&lt;/STRONG&gt; field is a &lt;EM&gt;date field&lt;/EM&gt;, but the &lt;STRONG&gt;Year&lt;/STRONG&gt; function in Arcade returns a numeric value. In order to call something like &lt;STRONG&gt;Year(Now())&lt;/STRONG&gt; and get 2022 stored in your field, it needs to be a different type.&lt;/P&gt;&lt;P&gt;Since &lt;EM&gt;Date&lt;/EM&gt; fields are really just integers representing "milliseconds since &amp;lt;your DB's reference timestamp&amp;gt;", you'll probably end up with a bunch of values just a few seconds after midnight on that reference timestamp, the way your field is set up now.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 20:33:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142326#M51192</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-02-09T20:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Year from Date &amp; Time field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142610#M51244</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;. I added a test field and made it numeric. Tried the Year(Now()) but that still didnt work. I know I'm not doing it correctly.&lt;/P&gt;&lt;P&gt;Ultimately I need to know if I can pull the year from a date and time field, and how I can do that in attribute rules.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So say for my date and time (field name TIME_DATE) field which is formatted as in the photo below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JessicaJThompson_0-1644502129949.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33601iC0D6EFC5EA19B76C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JessicaJThompson_0-1644502129949.png" alt="JessicaJThompson_0-1644502129949.png" /&gt;&lt;/span&gt;&amp;nbsp;how would I write the Arcade expression to pull just the year out, and have the column formatted as just the year and not an entire date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Jessica&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 14:12:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142610#M51244</guid>
      <dc:creator>JessicaJThompson</dc:creator>
      <dc:date>2022-02-10T14:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Year from Date &amp; Time field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142611#M51245</link>
      <description>&lt;P&gt;If you have a field "TIME_DATE" and you want to populate another column "YEAR" with the year, it would just be as simple as&lt;/P&gt;&lt;PRE&gt;Year($feature.TIME_DATE)&lt;/PRE&gt;&lt;P&gt;just like you have written in your original post.&lt;/P&gt;&lt;P&gt;What did your test field look like when you created it? Did it not fill in with numeric values?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 14:20:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142611#M51245</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-02-10T14:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Year from Date &amp; Time field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142621#M51247</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;Thank you for taking time to help me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok. that is what I put in! So we are getting close.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JessicaJThompson_0-1644503034156.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33604i00161B34B344FC30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JessicaJThompson_0-1644503034156.png" alt="JessicaJThompson_0-1644503034156.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JessicaJThompson_3-1644503497860.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33608i3884C2F2A23A8E5A/image-size/large?v=v2&amp;amp;px=999" role="button" title="JessicaJThompson_3-1644503497860.png" alt="JessicaJThompson_3-1644503497860.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JessicaJThompson_1-1644503298151.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33606i1C0B57C944E7D4BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="JessicaJThompson_1-1644503298151.png" alt="JessicaJThompson_1-1644503298151.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The very first time (when it was still a date field) it returned 1899. This time it returned a null value.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JessicaJThompson_2-1644503445244.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33607iBF5B7FFD106AF31D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JessicaJThompson_2-1644503445244.png" alt="JessicaJThompson_2-1644503445244.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 14:32:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142621#M51247</guid>
      <dc:creator>JessicaJThompson</dc:creator>
      <dc:date>2022-02-10T14:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Year from Date &amp; Time field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142625#M51249</link>
      <description>&lt;P&gt;If you just run a field calculation, does it work? Or are you manually triggering the rule some other way? I notice your rule is only set to fire on feature edits.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 14:43:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142625#M51249</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-02-10T14:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Year from Date &amp; Time field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142633#M51250</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It worked when I did a field calculate - so I added a new survey record and IT WORKED!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 15:09:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-year-from-date-amp-time-field/m-p/1142633#M51250</guid>
      <dc:creator>JessicaJThompson</dc:creator>
      <dc:date>2022-02-10T15:09:44Z</dc:date>
    </item>
  </channel>
</rss>

