i need to add 2 week to 02.01.2022.
Hello @Jayakiruba_Sekar ,
Use something like this in order to add a week to a date:
yourDateTimeVar.AddDays(7)
For two weeks you could use:
yourDateTimeVar.AddDays(14)
More info here: https://learn.microsoft.com/en-us/dotnet/api/system.datetime.adddays?view=net-7.0
Hope it helps!
Best regards,
Marius
Hello @Jayakiruba_Sekar
Welcome to UiPath community…!
You can sue the modify Date activity in UiPath.
Thanks
Hello Marius! what if i’m given the input in number of weeks
number weeks is dynamic. its an input from an excel. i need to add that to a date variable.
my input will be in weeks. either i need to convert weeks given to number of days and proceed or i need to add the week directly to date. not the days!!
Thanks Rahul! its really helpful.
Hi @Jayakiruba_Sekar ,
Considering the date value is already in DateTime
datatype variable. Also, we know 7 Days is a week.
Then we can use the number of weeks as the multiplier for 7 days.
yourDateVar.AddDays(7*yourNumberOfWeeksValue)