I'm using the format-date function to extract the various elements of date and time as follows but I cannot get the last element (0 padded seconds) to be anything other than 00 (i.e. '%S' below).
string(format-date(${dc_date},'%y'))
+ string(format-date(${dc_date},'%m'))
+ string(format-date(${dc_date},'%d'))
+ string(format-date(${dc_date},'%H'))
+ string(format-date(${dc_date},'%M'))
+ string(format-date(${dc_date},'%S'))
dc_date is defined as a datetime field with a default value of now() and bind::esri:fieldType to esriFieldTypeDate.
s_id is defined as a text field with the calculation set to the format-date function above and bind::esri:fieldType to esriFieldTypeString
I've tried changing the fieldTypes but this didn't have any impact.
Survey form spreadsheet with these two records is attached.
Anyone else with this issue / solution?
The result of the format-date calculation is as follows with the 00 at the end for seconds every time: 220707131700
Solved! Go to Solution.
Survey123 doesn't store time to the precision of seconds in the datetime field so string(format-date(${dc_date},'%S')) will always just return 00. I asked the about this at the developers conference and apparently it's intended behavior and there are no plans to change it.
Survey123 doesn't store time to the precision of seconds in the datetime field so string(format-date(${dc_date},'%S')) will always just return 00. I asked the about this at the developers conference and apparently it's intended behavior and there are no plans to change it.
Hi Andy,
Thanks for relaying that info.
Kind of frustrating that ESRI would say it is "intended" behaviour when they document it otherwise.
Again, thx for the info.