AnsweredAssumed Answered

Survey123 Date Time Calculation

Question asked by John.Broecher on Aug 24, 2017
Latest reply on Mar 26, 2018 by John.Broecher

Most of our Survey123 forms do not require a time entry that is different than the current time. One particular survey does need a time manually entered and the time spinner is proving to be very disliked. I've been asked to come up with a way to enter time as an integer. I have a date field that defaults to today which is what we want, and then the time is entered as a single 24-Hr clock integer (12:15 AM = 0015 or 15, 3:59 PM = 1559). I have a constraint that checks if its a valid time. What I would like to do now is combine the date field with the integer and make a DateTime hidden field.

 

constraint on time integer:

(round(${FishingStartTimeInt}-50,-2)<2400) and ((${FishingStartTimeInt}-(round(${FishingStartTimeInt}-50,-2)))<60)

 

For the calculation I have this non-working code:

format-date(Date('1970-01-01') + int(${FishingStartDate})+int(((round(${FishingStartTimeInt}-50,-2))div100)*3600000)+int((${FishingStartTimeInt}-(round(${FishingStartTimeInt}-50,-2)))*60000),'%m/%d/%Y %H:%M')

 

I get the error cannot handle Date function. Any suggestions?

Outcomes