Select to view content in your preferred language

convert unformatted date-time field (utc) to eastern time and extract day, month, or year

130
3
Thursday
Labels (2)
EricaNova
Frequent Contributor

I've got a hosted feature class with almost half a million records. I want staff to be able to filter this very large feature class by date in Field Maps, but that's not a feature yet.

Instead, I'm going to create text fields that hold all possible values for year, month, and day so that staff can filter with these criteria.

The only problem is, my feature class is huge and I'm not sure how to manage the timezone conversion. In Pro, I can easily calculate the day, month and year from the UTC datetime, but I need to convert to Canada/Eastern (America/Toronto) first, since that's what they will see in Field Maps on their devices. 

I've been mucking around for several hours with Notebooks and Field Calculator to no avail. I'd prefer a fast solution, but I'm not very experienced with Notebooks, so I keep getting bogged down.

My date-time field is named 'timestamp' and the fields I want to fill are 'year_', 'month_' and 'day_'.

Thanks for any help!

Erica

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

Time Zone (Environment setting)—ArcGIS Pro | Documentation

Convert Time Zone (Data Management)—ArcGIS Pro | Documentation

I don't know if this will help, but you have this under ArcGIS Pro questions, so perhaps start by having a look at controlling/converting time within Pro itself


... sort of retired...
0 Kudos
EricaNova
Frequent Contributor

I was trying to avoid adding a field to my layer, since it's part of an offline map, but adding a field, calculating eastern time using the convert time zone tool, then recalculating the month/day/year works. It takes a LONG time (25 minutes for 3300 points). Might have to leave my computer chugging away over the weekend...

0 Kudos
KimOllivier
Honored Contributor

It anything takes longer than a cup of coffee, interrupt the process and find a better way! It is likely that it will crash with no results if it has to run for days.

To update an online table from ArcGISPro it only works for a few records. If you need a bulk update the best way is to export the table to a local filegeodatabase, do the process on a local machine and then replace the online layer. The replace layer function actually does a Staging Update. This zips up the file and metadata for the layers, uploads and then unpacks in the cloud. This all takes a few seconds or at the most minutes.

 

0 Kudos