Select to view content in your preferred language

Date symbology in ArcPro

1246
1
Jump to solution
09-09-2021 08:34 AM
BobBoutiette
Occasional Contributor

I am using ArcPro 2.8.2.  I am using the unique value symbol option to symbolize by three fields one being a date field.  How can I exclude the time portion of the date to lessen the unique values.  I only want to use the month, day and year to determine uniqueness.  I've tried most of the date formats but they all seem to maintain the hour for the root attribution.

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

You can use an expression, rather than the value itself. Behind the scenes, a date field is just storing a timestamp integer; changing the format won't change the underlying value.

Here are a couple different options:

var d = $feature['date-field']

// To keep the output as a Date type. Cuts the time portion off.
return Date(Year(d), Month(d), Day(d))

// To convert to string. Lets you fine-tune how the output is formatted.
return Text(d, 'Y-M-D')

 

- Josh Carlson
Kendall County GIS

View solution in original post

1 Reply
jcarlson
MVP Esteemed Contributor

You can use an expression, rather than the value itself. Behind the scenes, a date field is just storing a timestamp integer; changing the format won't change the underlying value.

Here are a couple different options:

var d = $feature['date-field']

// To keep the output as a Date type. Cuts the time portion off.
return Date(Year(d), Month(d), Day(d))

// To convert to string. Lets you fine-tune how the output is formatted.
return Text(d, 'Y-M-D')

 

- Josh Carlson
Kendall County GIS