datetime data changes when saving my data using arc.write

446
2
11-28-2022 11:40 AM
Labels (3)
AiryPeralta1
New Contributor

Hi,

I pulled data that I collected using Survey123 from the cloud by using the R-bridge; I needed to perform quality control for some attributes. During my QC, the datetime field was not touched. Now, I am using arc.write to save my final product in a feature class on a local GDB, but then I note that while the dates are correct, the time is showing like the process of saving added 6 hrs.

So, for example, my first survey record started at 14:42 PM, and this was correct before I saved the feature dataset. After saving, ArcGIS Pro, indicates that the same record was collected at 20:42 (8:42 PM). How can I preserve the correct time? Is there any argument within arc.write() that I need to set?

 

0 Kudos
2 Replies
cmichaud
New Contributor

Never tried writing datetimes with the arcgisbindings package, however, I have had lots of experience writing data to .csv.  R's default behavior is to read datetimes in in local time and write them out in UTC.  I'd recommend forcing the time zone to UTC following import.  I frequently use lubridate::force_tz("UTC"), however you can do similar in base R.  Hope this helps and good luck! 

0 Kudos
AndrewPadilla
Occasional Contributor
I would venture to guess the time is stored as UTC and converted to local time during the process. Similarly, when viewing data in ArcGIS Pro it is in UTC and when viewed in a web map time is showing in local time.
0 Kudos