Subtract method can not use in date time


I wan to use subtract method for dates so i took 2 variables as datetime datatype and get today’s date in one variable and passed a default date in second variable:

i used one assign activity and use subtract method hence it is showing me error like this:
value of type “system.timespan” can not be converted to ‘date’

Please suggest

Hi @nsharma,

Subtract method takes argument of type System.TimeSpan.

Use Now.TimeOfDay which returns the TimeSpan object


@Madhuraj is it not possible to use subtract method for date only?

When i am using Now.TimeOfDay it is also showing me error that “timespan can not be converted to date”
am i supposed to change data type for today variable?


You can use following code



This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.