hi
i get date from xml in this format: 7/16/2010 (mm/dd/yyyy)
i have in my program datetime val - MyDate
.
and when i try to placing MyDate = Convert.ToDateTime(7/16/2010)
i got error.
how i can fix it ?
thank's in advance
hi
i get date from xml in this format: 7/16/2010 (mm/dd/yyyy)
i have in my program datetime val - MyDate
.
and when i try to placing MyDate = Convert.ToDateTime(7/16/2010)
i got error.
how i can fix it ?
thank's in advance
do you need to delimit your date with double-quotes?
MyDate = Convert.ToDateTime("7/16/2010")
as it's converting from string?
DateTime MyDate = DateTime.ParseExact("7/16/2010", "M/dd/yyyy", CultureInfo.InvariantCulture);