Getting unix epoch time from ODK date/time

In order to create a guaranteed unique identifier for each instance of a
form, I propose to concatenate the device IMEI with the unix time derived
from the 'start' type date-time.

I realise I could just leave that date-time as a string (?) but it would be
ugly. I presume that I can parse the date-time string within ODK and
calculate unix time (I haven't yet looked at string parsing options) but
that will be uglier!

Is there a simple way to make this conversion?

Or is there a better/simpler way to make a unique identifier? There is
nothing else in my form that is certain to be present and unique.

Thanks for your help, as you can probably tell I am new to ODK!

Hi Steve,

Welcome to ODK! If you are using XLSForm or Build, it already
generates a unique instance ID at meta/instanceID.

Yaw

ยทยทยท -- Need ODK consultants? Nafundi provides form design, server setup, in-field training, and software development for ODK. Go to https://nafundi.com to get started.

On Fri, Jun 24, 2016 at 2:51 PM, steve kemp skemp255@gmail.com wrote:

In order to create a guaranteed unique identifier for each instance of a
form, I propose to concatenate the device IMEI with the unix time derived
from the 'start' type date-time.

I realise I could just leave that date-time as a string (?) but it would be
ugly. I presume that I can parse the date-time string within ODK and
calculate unix time (I haven't yet looked at string parsing options) but
that will be uglier!

Is there a simple way to make this conversion?

Or is there a better/simpler way to make a unique identifier? There is
nothing else in my form that is certain to be present and unique.

Thanks for your help, as you can probably tell I am new to ODK!

--

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/d/optout.