I have extracted date in a form (dd.mm.yyyy) with Screen scraping - full text (while table was not redable with data scraping) and then with string manipulation got a desired form of date. I have also extracted loan duration which is given in a form of months (everything is a string variable). The end date should be as follows:
ED = dd.mm.yyyy + months = dd.mm.yyyy (new date should be in a same form as a start date).
Is there any “elegant” (short) solution how to solve this without using excel or e. scope?
Inside the Excel the solution is:
30.03.2017(date in cell A1) - start date
71 (number of months in cell A2) - duration in months
28.02.2023 (result in cell A3 using EDATE(A1;A2)) - end date
The above example should demonstrate what I want to achieve. I hope I was clear enough
We have predefined class to add months or days or hours whatever… So if you have starting date and number of months to add, you can simply use the above.
Thanks for Tipp, but my Start Date and Months (with full text extracted) are String variables and AddMonths function is not String member, so I can not project End Date by simply applying this function.
What other steps do I need to perform first (changing variables, converting?)
I used Full text activity and from the desktop app from certain field I have extracted date (for. example 30.03.2017 - in this very form. Then after navigating trough desk. app again I applied Full text and extracted number of Months (71). Both extracted data (Date and number of months are saved as a string variables.
I just want to get the future date = start date + number of months (in the same form as start date - 28.02.2023)
use split method with “.” like this:
strArr (array of string) = str11.Split({“.”},StringSplitOptions.None) —> by this you’ll get day, month and year separately.
use this day, month, year in declaration of new DateTime
d1 (Datetime) = New Datetime(Convert.ToInt32(strArr(2)),Convert.ToInt32(strArr(1)),Convert.ToInt32(strArr(0)))
Assign NewDate1 = d1.AddMonths(71) —> instead of 71, pass your variable having month. (to add 71 months in d1 (date))
print it in a form as you want it like —> Newdate1.ToString(“dd.MM.yyyy”)