Time difference calculation not working in web form

843
2
Jump to solution
09-30-2021 10:10 AM
JasonCyphers
Occasional Contributor III

Using the calculation int((${arrival_time}-${dispatch_time}) div (1000*60)) to calculate the response time (in minutes).

Formula works in connect and app, but not in the web form.

Is there an alternate formula I can use to obtain this value, that will work in the app and in the web form?

0 Kudos
2 Solutions

Accepted Solutions
JamesTedrick
Esri Esteemed Contributor

Hi @JasonCyphers ,

Please refer to the topic on decimal date time; the web app uses decimal dates (i.e., 1 = 1 day)

View solution in original post

ZacharySutherby
Esri Regular Contributor

Hello @JasonCyphers

The Survey123 website uses decimal date time whereas the field app uses both decimal date time and epoch time. The calculation you have written is in epoch time, your calculation will need to use decimal date time for it to work in both the Survey123 web app and field app. 

The calculation would need to be: int((decimal-date-time(${arrival_time})-decimal-date-time(${dispatch_time})) * 24*60)

Please see the Constraints and Calculations section of Ismael's Esri Community blog for reference. Please also see the Decimal date time documentation for more information. 

 

Thank you, 

Zach

 

Thank you,
Zach

View solution in original post

2 Replies
JamesTedrick
Esri Esteemed Contributor

Hi @JasonCyphers ,

Please refer to the topic on decimal date time; the web app uses decimal dates (i.e., 1 = 1 day)

ZacharySutherby
Esri Regular Contributor

Hello @JasonCyphers

The Survey123 website uses decimal date time whereas the field app uses both decimal date time and epoch time. The calculation you have written is in epoch time, your calculation will need to use decimal date time for it to work in both the Survey123 web app and field app. 

The calculation would need to be: int((decimal-date-time(${arrival_time})-decimal-date-time(${dispatch_time})) * 24*60)

Please see the Constraints and Calculations section of Ismael's Esri Community blog for reference. Please also see the Decimal date time documentation for more information. 

 

Thank you, 

Zach

 

Thank you,
Zach