Hi i’m new using uipath and its been great experience . Im wondering if the uipath can autodetect the date from the system and input the begin date and end date per month.
For example
Now is 4 January 2018
so i need to input 01-01-2018 and 31-01-2018 in text column
Sorry for my poor english and i hope its enough to understand my question
if today date = 4th Jan 2018 then beginDate.AddMonths(1).AddDays(-1) will give 3rd Feb 2018 which is wrong. Cause it is subtracting only one day where day can be any day of the month 1 to 31
Example given in ref link is correct where date is static with date 12/31/2015, we are adding only months.
by default while adding months if date is not in the range of resulted month then date is keep on reducing by 1 (please correct me if I am wrong) until it is in range.
@AkshaySandhu, Sorry if it is wrongly mapped. Refer the explanation given in Remarks Section in the above link.
The AddMonths method calculates the resulting month and year, taking into account leap years and the number of days in a month, then adjusts the day part of the resulting DateTime object
Hello @599712 my bad I didnt saw that your are using beginDate as date to get the last day of the current month. Your answer is correct .
Sorry for misunderstanding