Using date/timestamp in calculation fields returns date but no time

Hi,

I am trying to use some answers from my form plus the date and time to dynamically create a unique form ID for easier post processing - I want something more human readable than the builtin form ID. I am having difficulty in getting the timestamp to be integrated into the generated ID.

I made a calculated field called datetime_start to get the time and date in the required format:
concat(substr(${start},2,4),substr(${start},5,7),substr(${start},8,10),'-',substr(${start},11,13),substr(${start},14,16))

and made a note for testing :
start is ${datetime_start}

on the form preview inside kobo toolbox, that gives me the output i expect:
start is 230131-1934

however, when i deploy the form and test it in the app on my phone, I only see the date but not the time, like this:
start is 230131-

If I save the form and view the saved data, I can see 230131- as the value of the calculation, but in the built in “start” column I can see both date and time are being captured.

I also tested this using the now() and today() functions, and a time question with the default answer as now(), and I always get the same problem - it works on the browser but doesn’t work on the phone.

Can anyone see what I am doing wrong?

Thanks!

@ralphthompson, could you share the relevant part of your XLSForm with the community so that the community should also add to your XLSForm and help you solve your issue?

Sure, here is an example xlsform with the same issue:
timestamp problem.xlsx (8.9 KB)

For info, on the phone I am using KoboCollect v2022.3.6 on android. I tried on two phones (android, same app version) with the same result

Appearance in form preview:

Appearance in deployment:

Found a solution: using the builtin format-date-time function works in both preview and deployment:
format-date-time(${start}, '%Y.%m.%d-%H.%M')