replacement for DatePart in arcade for pro calculate field

207
2
Jump to solution
07-16-2021 03:04 PM
SteveGuiry
New Contributor

I was wondering if there is any equivalent for the DatePart helper from desktop? I am trying to get the date from 1-365 and have seen that DatePart ('y' [DateTime Field]) works, but have not been able to find the equivalent for pro in the calculate field.

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Notable Contributor

Text will do it. https://developers.arcgis.com/arcade/function-reference/data_functions/#text

Text([DateTimeField], 'Y')

Edit: 'DDD' in the format param will get the day number from 1 to 365.

- Josh Carlson
Kendall County GIS

View solution in original post

2 Replies
jcarlson
MVP Notable Contributor

Text will do it. https://developers.arcgis.com/arcade/function-reference/data_functions/#text

Text([DateTimeField], 'Y')

Edit: 'DDD' in the format param will get the day number from 1 to 365.

- Josh Carlson
Kendall County GIS
SteveGuiry
New Contributor

That did the trick for the most part! I had to omit the square brackets to get the desired values, and had to make a new field so the values were numeric for my purposes, but otherwise was exactly what I was looking for. Thanks

0 Kudos