Arcade Expression: Yesterday's Date

1749
1
11-06-2018 07:45 AM
PointIDS
New Contributor

Hello,

I am currently attempting to create an expression that will stylize points based on date. The aim is to turn all points that were created either yesterday or today one color and then all other dates a different color. I have successfully created an  expression that will accomplish this for today's date, but cannot figure out how to also include yesterday's date.

Current expression;

Iif( Day(Now()) == Day($feature.EditDate), "True", "False")

As there is not a function for "Yesterday" I assume one would need to use the DateAdd Function?

Thanks for your help!

0 Kudos
1 Reply
TanuHoque
Esri Regular Contributor

you can use DateDiff() as well.

i think following expression should return features older than yesterday.

DateDiff(Today(), $feature.EditDate, 'days') > 1