ArcGIS Pro 2.1, attribute rule, calculation contains this expression:
Text(Now(), 'ddd D MMM Y')
This gets inserted into the features attribute table, text field:
Wed 28 Feb Y
I also tried this expression:
Text(Now(), 'ddd D MMM yyyy')
This was the result:
Wed 28 Feb yyyy
Here's the workaround (messy):
var fir = Text(Now(), 'ddd D MMM');
var sec = Text(Year(Now()));
var arr = [fir,sec];
return Concatenate(arr,' ')
Yes, that doesn't appear to work correctly in Pro. If you use the expression "Text(Now(), 'ddd D MMM Y')" in the Playground, it returns the expected response. Using "Text(Now(), 'ddd D MMM YY')" in Pro returns Wed 28 Feb 18
It also doesn't seem to be an issue in ArcGIS Online:
Hey Dan,
Thanks for your post and the details. I tested the attribute rule expression in Pro 2.1.2 and it still seems to be an issue.
Text(Now(), 'ddd D MMM Y') ---> returned Thu 1 Mar Y
I am going to test a few more things and possibly write up a bug. I'll keep you posted.
Supriya
I tried the expression: Text(Now(), 'ddd D MMM YYYY') and returned the proper output: Thu 1 Mar 2018 and as Ken mentioned above Text(Now(), 'ddd D MMM YY') returns another proper result: Thu 1 Mar 18
However, since there is a difference between what Pro and Playground is returning for your original expression I have written the following bug:
BUG-000112055 - The Arcade function Now doesn't return the proper year when used as an attribute rule in ArcGIS Pro 2.1.2
Especially since this document states that a single Y is enough to reformat the date type:
It looks like the bug's synopsis was updated.
BUG-000112055 - The Arcade expression to format date in attribute rules doesn't return the correct year results
Thanks for the details kenbuja and thanks for the update Supriya_Khadke-esristaff!