<?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 Extract week number from Date and Time field using Field Calculator in ArcPro in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594159#M93842</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hoping someone can help me to extract the week number from a date and time field using Field Calculator in ArcPro. I've tried a few codes I've found online but nothing is working.&lt;/P&gt;&lt;P&gt;My layer is called oyster, my fieldnames are surveydate and weeknumber.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rachel&lt;/P&gt;</description>
    <pubDate>Tue, 11 Mar 2025 11:34:03 GMT</pubDate>
    <dc:creator>RachelS</dc:creator>
    <dc:date>2025-03-11T11:34:03Z</dc:date>
    <item>
      <title>Extract week number from Date and Time field using Field Calculator in ArcPro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594159#M93842</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hoping someone can help me to extract the week number from a date and time field using Field Calculator in ArcPro. I've tried a few codes I've found online but nothing is working.&lt;/P&gt;&lt;P&gt;My layer is called oyster, my fieldnames are surveydate and weeknumber.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rachel&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 11:34:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594159#M93842</guid>
      <dc:creator>RachelS</dc:creator>
      <dc:date>2025-03-11T11:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Extract week number from Date and Time field using Field Calculator in ArcPro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594166#M93844</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7812"&gt;@RachelS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My reading of your query is you need to calculate the week number of the data you have, I found the following link which might&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/date_functions/#isoweek" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/arcade/function-reference/date_functions/#isoweek&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This example from ArcGIS Survey 123 might also help&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-the-week-number-of-a-date/td-p/1217824" target="_blank"&gt;https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-the-week-number-of-a-date/td-p/1217824&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 11:56:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594166#M93844</guid>
      <dc:creator>DanielFox1</dc:creator>
      <dc:date>2025-03-11T11:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Extract week number from Date and Time field using Field Calculator in ArcPro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594177#M93846</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="date_ex.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/127588i7ED2D3FE81A1E8A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="date_ex.png" alt="date_ex.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;or via python builtins.&amp;nbsp; You just need to add an integer field to get the week number&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 12:51:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594177#M93846</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2025-03-11T12:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Extract week number from Date and Time field using Field Calculator in ArcPro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594192#M93851</link>
      <description>&lt;P&gt;If you shared some of the code samples you tried along with the errors or unexpected results, people could comment on why the code samples aren't working for you.&amp;nbsp; Also, sharing either example or sample data along with expected results helps people give better answers.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 13:19:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594192#M93851</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2025-03-11T13:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extract week number from Date and Time field using Field Calculator in ArcPro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594242#M93856</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Yes, this is the code I tried but I got the error message below.&lt;BR /&gt;My surveydate field is type 'Date' like&amp;nbsp;03/12/2024 16:44:00.000.&lt;BR /&gt;I thought it was because my week field was a string but when I created one that was an integer 'Long', I still get the error below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RachelS_0-1741701762661.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/127627iBE27E802DDF06151/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RachelS_0-1741701762661.png" alt="RachelS_0-1741701762661.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 14:02:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594242#M93856</guid>
      <dc:creator>RachelS</dc:creator>
      <dc:date>2025-03-11T14:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extract week number from Date and Time field using Field Calculator in ArcPro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594243#M93857</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;The code I tried is in Dan's reply above but I get the error in the screenshot posted above.&lt;BR /&gt;The sample date is&amp;nbsp;&lt;SPAN&gt;03/12/2024 16:44:00.000 and in another field called week I'd just like to get it return 49.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've 2000 of these records to update.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 14:05:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594243#M93857</guid>
      <dc:creator>RachelS</dc:creator>
      <dc:date>2025-03-11T14:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Extract week number from Date and Time field using Field Calculator in ArcPro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594247#M93859</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/612907"&gt;@DanielFox1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried the the isocalender but I'm getting an error posted in the reply to Dan,&lt;BR /&gt;The example from Survey123, I've implemented this in my Survey123 form so this won't be an issue going forward. I just have 2,000 records from the last few years I'm trying to get updated.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 14:07:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594247#M93859</guid>
      <dc:creator>RachelS</dc:creator>
      <dc:date>2025-03-11T14:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extract week number from Date and Time field using Field Calculator in ArcPro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594271#M93862</link>
      <description>&lt;P&gt;You can use the Arcade script&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;ISOWeek($feature.surveydate)&lt;/LI-CODE&gt;&lt;P&gt;This is how it would look in the Field Calculator (with my data)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_84ecaf.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/127635iB73FD643CF8881F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_84ecaf.png" alt="Snag_84ecaf.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 15:00:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594271#M93862</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-03-11T15:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extract week number from Date and Time field using Field Calculator in ArcPro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594319#M93866</link>
      <description>&lt;P&gt;That's it, works perfect, although I didn't have to put ISO in front of Week.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 15:58:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594319#M93866</guid>
      <dc:creator>RachelS</dc:creator>
      <dc:date>2025-03-11T15:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Extract week number from Date and Time field using Field Calculator in ArcPro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594325#M93867</link>
      <description>&lt;P&gt;you date field was a string that was the problem, if you try it with a true date field as input and the output field (week) as integer (long) it should work, as in my example&lt;/P&gt;&lt;P&gt;And you can use python outside of the esri environment &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 16:07:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594325#M93867</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2025-03-11T16:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extract week number from Date and Time field using Field Calculator in ArcPro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594327#M93868</link>
      <description>&lt;P&gt;There's difference between the two. &lt;A href="https://developers.arcgis.com/arcade/function-reference/date_functions/#week" target="_self"&gt;Week&lt;/A&gt; returns a value where the first week is 0 while &lt;A href="https://developers.arcgis.com/arcade/function-reference/date_functions/#isoweek" target="_self"&gt;ISOWeek&lt;/A&gt; returns a value where the first week is 1. Take a look at the difference using your example date (remember that month is zero-based)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_c25e0e.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/127645iD7063FB1321AFD18/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_c25e0e.png" alt="Snag_c25e0e.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 16:08:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594327#M93868</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-03-11T16:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Extract week number from Date and Time field using Field Calculator in ArcPro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594669#M93900</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's interesting, how do I get the field to be a true date field? The properties of the field in ArcPro is 'Date' type.&lt;/P&gt;&lt;P&gt;I even created a new field in ArcPro as type Date, copied over the data and ran it but it still did the same.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 11:35:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-week-number-from-date-and-time-field-using/m-p/1594669#M93900</guid>
      <dc:creator>RachelS</dc:creator>
      <dc:date>2025-03-12T11:35:54Z</dc:date>
    </item>
  </channel>
</rss>

