Decimal-date-time does not seem to work on ODK Collect as it does on Enketo or other webforms

Using the decimal-date-time on datetime questions to allow for computation of time difference between two datetime question one can always use the example below

Unfortunately, the operation only works on webforms to produce the exact number of hours while on ODK Collect this only returns the hours rounded off to days i.e. 24, 48, 72 etc.

An example of such a form is here Hours Calculated Between Dates v2.xlsx (18.9 KB)

I had to change the logic for calculating the difference by splitting the datetime into two questions, date and time. And using absolute date difference and decimal-time difference between the times measured. This is the only approach that works on Collect.

Hours Calculated Between Dates v3.xlsx (19.9 KB)

To reproduce
I suggest that you test the two forms I have uploaded on both web forms and collect


  1. Is this a known bug with the latest collect
  2. Has this ever occurred in previous versions of collect


Hi Stephane:

In this post you can see a function for calculating the difference between times that provides the same results in Enketo and in ODK Collect.