Removing the Time from a Date field for a label expression

637
3
Jump to solution
07-15-2021 10:53 AM
Labels (2)
DamianSmith
New Contributor III

I"m trying to remove the time stamp from my Date Field. As I only need to display the M/D/YYY along with the acreage and unit name. However, When I attempt the remove the date, with the following expression. I get an invalid expression. Do  I need to break the expression for Date field up using Day($feature.Dated) + "/" +, etc?

I've included an example of what I'm looking for at minimum using the old expression and what that expression displays along with what is displays using an older data source.  My data source is a web feature layer, so I have to use arcade for the expression. Any help would be appreciated                                                                      Label_format.JPG     Label Expression.JPG

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Notable Contributor

Having the Text function as you've written it needs a comma between the parameters.

If you're just concatenating text, you should be able to do away with the outer parentheses. Also, it's a good idea to break your expressions into multiple lines so that you can more easily identify where errors are occurring.

Try this:

$feature.Burn_compartment + " " +
$feature.Acres_shor + "ac " +
Text($feature.Date, 'M,D,Y')

 

- Josh Carlson
Kendall County GIS

View solution in original post

3 Replies
jcarlson
MVP Notable Contributor

Having the Text function as you've written it needs a comma between the parameters.

If you're just concatenating text, you should be able to do away with the outer parentheses. Also, it's a good idea to break your expressions into multiple lines so that you can more easily identify where errors are occurring.

Try this:

$feature.Burn_compartment + " " +
$feature.Acres_shor + "ac " +
Text($feature.Date, 'M,D,Y')

 

- Josh Carlson
Kendall County GIS
DamianSmith
New Contributor III

Thanks, I missed that error. 

0 Kudos
RobertBorchert
Frequent Contributor III

Here is a different variation.  

 

Month($feature.CREADATE) + "/" +day($feature.CREADATE) + "/" + Year($feature.CREADATE) 

results look like   7/16/2021