Hi all,
Hopefully the last issue for this bot:
I have scraped the date from a table and am subtracting today’s date from it to give me a value.
The date being scraped is correct and so is today’s date, but it is giving me the wrong delta. It worked before and I wonder if this is because of the date format (ie 2 digits in day column now opposed to one). I need a formula that will scrape and calculate the change in dates regardless if there are 1 or 2 months in the month and day digits. Does anyone know how to do this? I will post my current calcs below:
Extract last row in table: CellCount = ExtractDataDate.Rows.Count-1
Get Date: MySingleCell = ExtractDataDate.Rows(cellCount).Item(0).ToString
*then i split and trimmed the string to get what i wanted and made variable ‘yourdateasstring’
converted string 2 date:
yourdate = DateTime.ParseExact(YourDateAsString,“M/d/yyyy”,System.Globalization.CultureInfo.InvariantCulture)
Took today’s date: todaysdateandtime = datetime.Now
took out time: todaysdateraw = todaysdateandtime.Split(" "c)(0).ToString
Converted today’s date:
todaysDate = DateTime.ParseExact(todaysdateraw,“M/d/yyyy”,System.Globalization.CultureInfo.InvariantCulture)
Subtracted dates:
daydelta = yourDate-todaysDate