C# How to change date format in a text string?

Hello! Doing some tests on my website using Selenium + C# . Like unpleasant history:
On the website there is a block in which 3-5 lines of text here in this format:

Periods of use the hard drive:
c 01.11.2011 on 21.02.2012: Датацентр1
c 28.03.2012 at 12.08.2017: Датацентр2
c 12.08.2017 in the moment: Датацентр3

I get these lines in a collection thus:

IList<IWebElement> Collection = Driver.FindElements(By.CssSelector("#checkHardDrive > div > ul.Periods li"));

After that deduce in the program information in WindowsForm in the text box in which Multilin:
foreach (IWebElement element in Collection )
 this.period.BeginInvoke(updateTextPeriod element.Text);


In principle everything works, but there is one thing.
The date in the text box is displayed as c on 11/1/2011 2/21/2012, etc.
I.e. it is necessary to change the date format that is displayed in the text box.

Tell me, do I understand correctly that I need to take each item to parse it using regexps to numbers, write the value 1 to a variable, then parse the date itself, then another text, then another date, etc., and then separately to translate the date format and then all glued back into one line and output already in the text box?
Just suddenly there is some simpler solution?
March 20th 20 at 11:47
1 answer
March 20th 20 at 11:49
1 - if your browser displays the date as you need* - find another way to get the data
2 - if this is not possible, you will need to parse each line, highlight dates, convert them, and only then display. this is the programming life

then all glued back into one string
not necessarily enough to make a replacement date in the "bad format", "good"

pps * I suppose you are using Selenium? if Yes, and
in the browser the date is displayed as you need
- 99% that there is a way to get the desired row immediately. if not, in General, this task is not very difficult, and it is useful for the development of skills
Yes, use Selenium. Have not yet found ways to get a date string in the correct format. Only the transformation of the already received data) - Clovis commented on March 20th 20 at 11:52
@Ethyl.Jonand the browser shows? if
c on 11/1/2011 2/21/2012
and seek not what is, but if
c 01.11.2011 on 21.02.2012
explore ofrendering browser line, in the "developer tools" of the browser - Zander.Wisozk commented on March 20th 20 at 11:55

Find more questions by tags ChromiumC#Selenium