TestProject Forum

How to Increate a date value by some number of days

Hi,

How can i add 6 days to some date value and get new date value in an output parameter.
Example: My date format is mm/dd/yy, i have input date value as 10/31/21 now i want to add 6 days to 10/31/21 so i get new date as 11/05/21

I am using below function to do so but my new date i am getting is 10/05/21, month value is not getting changed here. I am expecting date value to be changed as 11/05/21

Thanks,

Hi @sahanijuttukon,
You can use the action Get Future or Past Date:

image

Starting date (at time of execution is 10/26/2021)
With 6 days.

To get the result:

image

If you need to input a specific value and then change it Set days of a DateTime object as its name suggests only changes the days. however, it also changes the months if the days’ value has been reset.

Let me know if you have any other questions and feel free to use @Amit.Lacher .

Hi Amit,

‘Get Future or Past Date’ did not work well, every time i run its giving some random date values and there is no option where i can input starting date value.

‘Set days of a DateTime object’ changes only date value, ideally after 30th or 31st day of a month the date need to go to next month but this action only changes the date not the month i think this is not of great use, no one would want to go back to the same month after 30th or 31st day of that month, this is a bottleneck here.

My requirement is i will input StartDate value and based on this date i want to increase the date to future dates with a parameter value like 3, 7, 8, 5 , 16, 30 any random number will be passed with parameter. Based on the Date of the month the value need to be incremental with the given parameter values.
Example: If i give date 10/29/2021 and increment value 5 then the output date need to be 11/03/2021
If i give date 12/25/2021 and increment value 8 then the output date need to be 12/02/2022

Thanks,

Hi @sahanijuttukon,
The ‘set days of a date-time object’ does change the month in case the days have been reset as can be seen here: