Where do "Start" and "End" Date/Times Come From.

4926
2
04-06-2016 12:38 PM
DeanMostad1
New Contributor II

I have created a Survey with the following date fields (I have other fields of course, but that's not the issue). And I re-post this because an additional item was closed without being answered correctly in my mind.

I have...
Type=Date
Type=Start
Type=End

for date fields. Respectively I get... From the same records
Type=Date... 3/22/2016 5:00:00 AM (ALWAYS CURRENT DATE AND 5:00 AM.)
Type=Start... 3/22/2016 7:15:05 PM
Type=End...3/22/2016 7:19:38 PM
Notes for this record from the person collecting the data showed 2:16 PM

Can you see my concern here? Where are the times coming from. Granted the hand entered 2:16 pm may either be central time or mountain time as we work in both zones, but again that is not the main point. Where are these times coming from, the Arc GIS online Server? Somewhere in England? The variance in my dataset between the DATE and the START and END times is consistently 5 OR 6 hours off. I'm OK with that point but How can I change it. Our standard since we commonly work in both time zones is to collect all of our data in CENTRAL STANDARD TIME, is there any way I can set Survey123 to collect data in that specific time? Again, I really just want to know WHERE the Start and END times come from?

Suggestion to my fellow Survey123 users is to use a START time for the survey along with Date and then do some sort of conversion as I have yet to see DATE give anything but the date and an hourly time.

Any Help would be appreciated. and also this is consistent with several different tablets in the field and all tablets are set to the current local time.

Any Ideas?

0 Kudos
2 Replies
IsmaelChivite
Esri Notable Contributor

Hi Dean,

  sorry we did not take your question earlier. I had seen your note some time ago, but could not find time to respond.  I did a quick test with the attached XLSFile (Times.xlsx), which I think will bring some light into how things work. You will find there the following:

  • A dateTime question with a default of now()
  • A date question with a default of today()
  • A dateTime question with a default of now(), but mapped to an esriFieldTypeString (as opposed to the default mapping, which is an esriFieldTypeDate)
  • A time question with a default of now()
  • start and end questions

Once published, I captured data and sent to a feature service. The following screenshot shows the results:

Times.png

Here is what happened:

  • My dateTime question stored the exact time and date at which the Survey was opened.
  • The date question stored the date at which the Survey was opened, and set the time to the beginning of the day.
  • The dateTime question stored the same value as the first question, but persisted the value as a string, rather than as Date Time object
  • The time question also stored the current time, but as a string
  • Start and End stored the date time objects when the Form was opened and flagged as completed (when I tapped on the bottom right button saying I am done). I opened and closed quickly, and that is why the time shows as the same.


Here are a few things to keep in mind:

  • In an Esri geodatabase, there is only one field type that can properly handle Dates and Times. In geodatabase jargon we say it is a field of type esriFieldTypeDate, although in practice, this type of field is really storing both a Date and a Time.  It is not possible in a geodatabase to store simply a time object or just a Date. You always need to store both.
  • In Survey123, by default we map dateTime and time questions into an esriFieldTypeDate column in your Feature Service. That explains why with the date question, we also persisted the time of the beginning of the day.
  • Survey123 will always persist date and dateTime  as UTC time. This is useful, because allows you to have people in different time zones and still get the correct time when you look at the data. That is exactly what the ArcGIS.com Map Viewer is doing (see screenshot above).  The client app looking at the data realizes that the date objects are UTC and translates the time to your own time zone.  You will know what I mean if you change the Time Zone of your computer, and look at the data again in ArcGIS.com. Note that when we stored the date as a string, the client was not able to translate anything. It gives you the raw date time data.
  • In some cases, Survey123 will store your Dates and Times as strings:
    • If you use a time question, we always store values as a string. We did this because in Esri it is not possible to persist just a time object.  For example, if you want to capture the time at which a store opens, we would not want you to have an arbitrary date stored as well.  So we map time questions to string fields.  In this case, you really need to know to which Time Zone the data applies.
    • If you explicitly map a date or dateTime question to a string field (like I did with one of the questions in my Survey), then we store the value as a string.

The above goes in detail into how dates and times work in Survey123. I understand that your question was very specific: what start and end really mean? By the book, start and end where added to help you figure out how much time the enumerator spent filling out the survey. This can be useful when doing QA\QC.  Again, by the book, start will capture the time when the Survey is originally opened, and end when the Survey is flagged as completed. That is, when you tap on the bottom-left corner of the Survey to either save the data locally, or send it.  There can be a big difference between the time when the survey is flagged as done and the time when the data is actually sent.

I hope this will clarify a bit what you should expect.

Thanks,

Ismael

DeanMostad1
New Contributor II

Thank you, your answer explains it perfectly and the potential work arounds. I'm sure others will find this info valuable as well. Keep up the good work on the product!

Dean

0 Kudos