Select to view content in your preferred language

Extract week number from Date and Time field using Field Calculator in ArcPro

644
11
Jump to solution
03-11-2025 04:34 AM
RachelS
Frequent Contributor

Hi,

 

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.

My layer is called oyster, my fieldnames are surveydate and weeknumber.

Thanks

 

Rachel

0 Kudos
11 Replies
RachelS
Frequent Contributor

That's it, works perfect, although I didn't have to put ISO in front of Week.

Thank you!

0 Kudos
KenBuja
MVP Esteemed Contributor

There's difference between the two. Week returns a value where the first week is 0 while ISOWeek 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)

Snag_c25e0e.png

0 Kudos