Calculating Duration

I have two date time elements within a form and I am looking to calculate the difference between the two (duration). Please can someone advise the best approach in order to achieve this?

1 Like

Hi Damian,

I don't think that's possible. See
https://groups.google.com/d/msg/opendatakit/um9g921Qu1c/nHjlkM2rVFEJ
for some approaches that might work.

Yaw

ยทยทยท -- Need ODK services? http://nafundi.com provides form design, server setup, professional support, and software development for ODK.

On Sun, Feb 23, 2014 at 11:41 PM, DamianLindley@aol.com wrote:

I have two date time elements within a form and I am looking to calculate the difference between the two (duration). Please can someone advise the best approach in order to achieve this?

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Additionally, I have since added

decimal-date-time(.) and decimal-time(.) which convert dates and times to
a

days.fractional-days

decimal value (like used inside Excel).

The intent was to allow formulas like:

decimal-date-time(${end})-decimal-date-time(${start})

to give you the elapsed fractional days of an event.

HOWEVER, because of additional logic in the bowels of the Javarosa
implementation to handle broken time zone treatments, it is now highly
likely that the time portion of a date-time value will be lost during any
and all calculations.

Be sure to test this extensively if you try to use it. Early reports are
that this is horribly broken.

Mitch

ยทยทยท On Mon, Feb 24, 2014 at 3:20 PM, Yaw Anokwa wrote:

Hi Damian,

I don't think that's possible. See
https://groups.google.com/d/msg/opendatakit/um9g921Qu1c/nHjlkM2rVFEJ
for some approaches that might work.

Yaw

Need ODK services? http://nafundi.com provides form design, server
setup, professional support, and software development for ODK.

On Sun, Feb 23, 2014 at 11:41 PM, DamianLindley@aol.com wrote:

I have two date time elements within a form and I am looking to
calculate the difference between the two (duration). Please can someone
advise the best approach in order to achieve this?

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google
Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com