Time Calculations in Seconds in Survey 123

1963
7
12-12-2018 06:51 AM
VincentAbere
New Contributor II

Am looking to do time calculations in survey123. i have a form where am collecting behavior observation data on elephants. One piece of data is Out of View which needs to be displayed as a sum of total seconds when an elephant was out of view. Am having trouble figuring out how to display the time in seconds between observations. I am only able to display seconds in multiples of 60. ie 60, 120, 180 etc. How do you format the date time to display all seconds e.g 64, 118 etc and not in multiples of 60 seconds. It would have been great to have the capabilities of a stopwatch/ timer available in the survey from. 

0 Kudos
7 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Vincent,

The time controls in Survey123 have a resolution of 1 minute.  To record seconds, you would need to provide a numeric input (likely in a repeat to support multiple observations).

0 Kudos
VincentAbere
New Contributor II

Hi James

Thanks for your feedback. Does this mean i can only display the seconds in multiples of 60 seconds ? What i needed was to be able to read the seconds in between the 1 minute resolution as you say directly from the system time and have it displayed. I this possible with the app? Thanks

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Vincent,

Automatically measuring time in seconds isn't directly supported in Survey123.  It can be done by using the now() function in 2 questions to get timestamps.  By clearing out and recalculating the values, you can create a counter.  See the attached form.

0 Kudos
RawandDizayee
New Contributor III

Dear James,

Regarding measuring time in second you attached the Excel sheet it was not clear for me how it measures !!

because i use " ${task_order_organization_code} + '-NTS-' + format-date(${nts_date},'%Y%m%d') + '-' + format-date(${nts_time},'%H%M') " for ID reports to not get duplicate ID but now i see if two field reporters open the survey at the same time we will get duplicate ID so we need add second for ID as well to not get duplicate ID.

any suggestion it will be appreciated 

0 Kudos
FRSadmin
New Contributor III

Hello James,

Maybe seeing my quandry on another page.

I am doing something similar and not so similar at the same time.

We need to display the time of each repeat added to the second mark..

Is there anyway to use the second data from now() and display it

0 Kudos
EvanR
by
New Contributor III

@JamesTedrick, any chance of the resolution for time controls changing to seconds? Seems odd not to have direct access to seconds. I am working on a survey with lots of time fields and need access to seconds so that data recording can be aligned with recorded video. It seems like I'm going to have to do all manner of complicated workarounds in order to use seconds in the way that I need to.

EvanR
by
New Contributor III

I ended up having to add 31 calculate questions to the survey (more than 1/4 of the total lines in the XLSForm) in order to generate time intervals with seconds. I think it would have taken about 3 questions if seconds were supported directly, and would be a lot less prone to logic errors.

0 Kudos