Set automatic date (month)

Welcome @pincambo,
The format-date() function will provide the elements you need to develop your calculation. You can also add and substract from a date type variable with the decimal-date-time() function.
The date() function can convert a string (e.g. ‘2022-12- 31’ to a date type.

Be aware that today() is always updating on edit/save of a form (even on server edit later). If you want to avoid this you need to use once( today() ) or the metadata today (${today}).

All available date functions can be found here
ODK XForms Specification.
Other hints on date variables can be found in the Help Center article
Date and time question types — KoboToolbox documentation.

With the search function of this forum you can find many examples to for date calculations, e.g. Calculate number of days between 2 dates - #6 by Kal_Lam

2 Likes