So I'm maintaining a feature layer on Portal. When new data comes in, I upload the data into Pro, do a little formatting and then overwrite the Portal web layer. I have one date field called Last_Updated in my layer. After the overwrite, when I view the layer on Portal the date field always shows the date before and sets the time by default at 8:00 PM. Ex: The date I'm trying to set is 5/2/2019, and it shows up as 5/1/2019 at 8:00 PM.
When I load the online layer back into Pro it looks fine, but in Portal it doesn't. Any suggestions? Is there a way to calculate the field in Portal?
It doesn't necessarily set the time default to 8:00 PM. Instead, the Portal web maps automatically convert any dates to your local time zone. The web map assumes the date stored in the database is in UTC, so it automatically does a conversion to your local time zone. If you do not specify a time in your date, then it assumes the time is midnight. Therefore when the web map does the conversion, it converts the date from 5/2/2019 12:00 midnight to 5/1/2019 8:00 PM.
When viewing the data in Pro, it displays the raw data with no time zone conversions. A solution for this might be specifying a time in your data (maybe like noon) that way when the web map does the time zone conversion, it is still in the same day.
Thanks for the insight.
I did a similar work around. I placed the time at 5/2/2019 at 4 AM, and then it readjusted the time to 5/2/2019 at midnight. IN ADDITION, it should be worth noting that in Portal under Visualization under Configure Attributes, there's an option to disable the time parameter in the date field. So I disabled it and it's one less thing to worry about as I only need to be concerned about the date.