Hi
These are the expression you can use in assign activity
In days
int_days = DateDiff(DateInterval.Day, DateTime.ParseExact(Strinput.ToString, “dd/MM/yyyy”, System.Globalization.CultureInfo.InvariantCulture),DateTime.now())
Output type is int32
Input you can pass the string to variable named Strinput = “17/09/2022”
In months
int_months = DateDiff(DateInterval.Month, DateTime.ParseExact(Strinput.ToString, “dd-MMM-yyyy”, System.Globalization.CultureInfo.InvariantCulture),DateTime.now())
Output type is int32
You can get to know all sort of Datetime expressions from this post
Hope this helps
Cheers @aqiffm