Date Inconsistencies Between AGOL and Pro

542
3
02-12-2021 10:45 AM
TiffanyWu1
New Contributor II

Hello. I am working off of a hosted feature layer in AGOL and making changes in Pro. Working with my date field, I am noticing strange inconsistencies between Pro and AGOL. First off, Pro only includes the date and not the time, whereas upon publishing to AGOL it automatically shows the time (which I know I can toggle off in the attribute settings).

However, I was very confused to see the actual dates being wrong. Where Pro says 1/1/2021 and 12/1/2020 (the correct dates), AGOL displays the day before, which is 11/30/2020 and 12/31/2020, which caused me a lot of confusion trying to figure out why my 1/1/2021 date did not exist in my linked feature layer. Please see my attachments following this - and ignore the "Add to Database" field being different as that is due to labels. If anyone can help me figure this out, it will very much help with future dates down the line. Thank you. 

0 Kudos
3 Replies
MegHoole
Occasional Contributor III

This may be related to AGO handling the dates as UTC.  There is an arcade function that you can use to convert the dates in your table to UTC in AGO for labels, popups.

TiffanyWu1
New Contributor II

That's a good point, I think you're right. So when I hover over the hosted feature layer field in Pro it says UTC and if I go to my local one prior to publishing, it does not have a time zone - is that because when the data is put in Pro it uses my current time zone? I found a resource for the attribute arcade expression but I wouldn't really need the field for labels or pop-ups at this time, just for informational use.

I just worry that if we end up exporting the data to work off of it / analyze the dates, the dates will be wrong. And since our data is monthly we'd like December to say 12/1 rather than 11/30. Do you have any insights on how the date time format might work when it comes to a web app editor where we are adding points and putting in the current date? I would want it to reflect the correct date rather than an arbitrary time. 

0 Kudos
MarkGilbert
Esri Contributor

Take a look at this resource about publishing hosted features layers.

I do not believe you have to bother with converting dates using Arcade. Review the resource and I believe you will find there is a Time Zone setting you should set as part of your publishing workflow.

Be default, AGOL assumes your dates are in UTC. So if they are not, you can specify what they are and AGOL will correctly interpret the dates when published. 

0 Kudos