When creating a product object that has a DateTime field that field filled it with a
DateTime.Now
that data is saved in a txt as 03/09/2018 08:42:18 p.m and trying to get the data again with a DateTime.Parse(corte[2])
I get that no se puede reconocer la cadena como un comando date time valido
also probre with
string format = "dd/MM/yyyy hh:mm:ss tt";
DateTime.ParseExact(corte[2], format, CultureInfo.InvariantCulture)
Thanks to a user I started to search if corte[2]
was taking the value well and I was not taking it well, since I use it to cut a line with split(':')
had not realized that I was separating the time and it took a bad date, since I used it to separate fields like name, code.
My second doubt is that in DateTime.Now
I do not keep the time if not just the date.