Converting number to date in a server action

Hello,
anyone could help me, I have an issue that I do not find answer to, I need to be able to convert number to datetime and add it to "ended_date":

Basically in "ended_date" fieId I need to get {{NOW}}+"{{$_POST.validity_in_days}}" and get a datetime.
"{{$_POST.validity_in_days}}" posts a number.
I've tried to do "set value" before database insert with no luck, maybe anyone could help me in logic how it's done ?
Thank you.

You need to use DateAdd:

you mean like this?:

somwhow it adds over 1 year from 45 days that it should, any ideas?:
image

  1. Verify that the POST value is correctly received through the FORM.
  2. Try to use $_POST.validity_in_days.toNumber()
  3. Check that NOW returns exact today's date
1 Like

@Notum thank you very much! your code modification did the job!
But it seems to me that it would be impossible to move forward without community help..

Next time when it comes to data modification/extracting/everything - try to browse each section of Data Binding (it may differs from the data type you're trying to modify). It has almost everything that you'll need in everyday development.