Recording hours, minutes and seconds using a dateTime nodeset in XML Form


I've currently hit a snag with a form that I've built for ODK Collect and ODK Central that is supposed to collect a Timestamp for the data entry. At the moment, I'm doing that by having the user record a dateTime. Unfortunately, for reasons that are complicated, I need the date, hour, minutes AND seconds for the data entry. The data that I have coming through from the form seems to set seconds to zero (00) suggesting that seconds were never recorded via ODK Collect. Does anyone have any idea on how I might obtain a timestamp that includes seconds? Some further detail below.

Thanks again,


1. What is the problem? Be very detailed.
I have an ODK Collect form that collects a dateTime input. When we view the data on ODK Central, the seconds for the time is always recorded as 00 instead of the actual seconds. Is there any way to force the form to also record seconds? I'm sure it seems strange to require this level of precision, but for our use case it is. Currently, my nodeset in the XML form is:

<bind nodeset="/data/Trap_Deployment_Time" type="dateTime" required="true()" jr:preload="timestamp" jr:preloadParams="start"/>

2. What app or server are you using and on what device and operating system? Include version numbers.
ODK Collect on a Samsung Tablet and ODK Central v1.0

3. What you have you tried to fix the problem?
We found that ODK has a format-date-time function, but are not sure how to use this in the Nodeset and if this would even fix the problem. When entering the dateTime data through the ODK Collect App, it only shows inputs for hour and minute, so we're not convinced that seconds is being recorded anyway (regardless of formatting). Does anyone have any insight on this?

4. What steps can we take to reproduce the problem?
Look at inputs for forms that have a DateTime field.

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.

Hi @dan_p
DateTime widgets ignore seconds taking into account hours and minutes.
I'm not sure what your case exactly is but you can also use:
start metadata or Logging enumerator behavior

in both cases seconds should be saved.

Hi Grzegorz, thank you - that looks like it's exactly what I need! Once again you have come to me rescue :slight_smile: