AnsweredAssumed Answered

Date labeled wrong with Arcade

Question asked by jeff.thomasilm on Nov 14, 2019
Latest reply on Nov 15, 2019 by xander_bakker

I keep losing a day when labeling with Arcade. I have a date field (not text) with manually entered dates, e.g., "5/1/2003". I did not enter any times. If I label it with Python by simply calling the date field, [Date], it returns exactly that date and formatting. If I call the field with Arcade, $feature.Date, it labels as: "2003-04-30T20:00:00-04:00". I figured out how to format the date: Text($feature.Date,'M/D/Y'), and though it's kind of annoying that that's necessary when using Arcade, I at least get it. But the head-scratcher is why I've lost a day. Note that the labeled date is 2003-04-30 (or 4/30/2003), not 5/1/2003 as it should be. I'm sure it has something to do with the time shift. But the question is, how do I prevent this from happening? Do I have to reformat my data? Seems silly that I should have to do that, but at least I'd know what to do. Or is there a way to leave the data as it is and use Arcade to re-format properly? Thanks!

Outcomes