# Time difference calculation not working in web form

790
2
09-30-2021 10:10 AM
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?

2 Solutions

Accepted Solutions
Esri Esteemed Contributor

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

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
2 Replies
Esri Esteemed Contributor

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

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