ODK XForms format-date Hour and Minute coming out as 0000

437 views Asked by At

I am trying to create a calculated variable using the value entered for RecorderID - ClusterID - MonthDataHourMinute from when the survey was started. Right now I am getting everything except the hour and minute, so I assume my format for hour and minute is wrong. Any ideas?

format-date(/data/StartTime,'%m%d%H%M')

Thanks! Alex

  <bind nodeset="/data/StartTime" type="dateTime" jr:preload="timestamp" jr:preloadParams="start"/>
  <bind nodeset="/data/meta/instanceID" type="string" readonly="true()" calculate="concat('uuid:', uuid())"/>
  <bind nodeset="/data/p_RecorderID" type="int" required="true()" maxLength="3" constraint="regex(., '^[0-9]{3}$')" jr:constraintMsg="Invalid. Recorder ID code is 3 numbers long."/>
  <bind nodeset="/data/p_DistrictID" type="string" required="true()" db_get="col_1"/>
  <bind nodeset="/data/p_EUID" type="string" required="true()" db_get="col_2" db_filter_by_col_1="/data/p_DistrictID"/>
  <bind nodeset="/data/p_ClusterID" type="string" required="true()" db_get="col_3" db_filter_by_col_2="/data/p_EUID" db_filter_by_col_1="/data/p_DistrictID"/>
  <bind nodeset="/data/p_Consent" type="select1" required="true()"/>
  <bind nodeset="/data/p_HowLongLived" type="int" relevant="(selected(/data/p_Consent, 'Yes'))"/>
  <bind nodeset="/data/p_Sex" type="select1" required="true()"  relevant="/data/p_HowLongLived > 9"/>
  <bind nodeset="/data/p_AgeYrs" type="int" required="true()"  relevant="/data/p_HowLongLived > 9"/>
  <bind nodeset="/data/p_Travel" type="select1" required="true()"  relevant="/data/p_AgeYrs > 19"/>
  <bind nodeset="/data/p_IVM" type="select1" required="true()" relevant="/data/p_AgeYrs > 19"/>
  <bind nodeset="/data/p_IVMWhere" type="select1" required="true()" relevant="(selected(/data/p_IVM, 'Yes'))"/>
  <bind nodeset="/data/p_IDMethod" type="select1" required="true()"  relevant="/data/p_AgeYrs > 19"/>
  <bind nodeset="/data/p_BarcodeID" type="barcode" required="true()" relevant="(selected(/data/p_IDMethod, 'Scanner'))"/>
  <bind nodeset="/data/p_GenerateID" type="string" required="true()" readonly="true()" relevant="(selected(/data/p_IDMethod, 'IDGeneration'))" calculate="concat(/data/p_RecorderID, '-', /data/p_ClusterID, '-', format-date(/data/StartTime,'%m%d%H%M'))"/>
  <bind nodeset="/data/p_AdditionalNotes" type="string"/>
0

There are 0 answers