See correct syntax/argument order here ODK XForms Specification “Returns the substring beginning at the specified 0-based start index and extends to the character at end index - 1.”
Concerning now(), also check this issue, please. (@Kal_Lam)
You may also use uuid() function instead: ODK XForms Specification