I having a string strBuzday
whose value is "09-19-2018"
.
string strBuzday = "09-19-2018";---Line 1
The next line is:
DateTime dt = Convert.ToDateTime(strBuzday);---Line 2
The above code does not work and
"String was not recognized as a valid DateTime" (Format exception is being thrown)
in Line 2.
I have two questions:
1.How to solve this?
2.What could be the reason as the same code works for every other developer in my team with every configuration in Visual studio being exactly the same,it does not work only for me.Why?
Edit:
I ran the code in my machine and my co-workers machine and the result was same --9/20/2018 10:09:09 PM
-- on the both the systems. One only difference between all other co-workers and my system is they are all on Windows 7 or 8 and I am the only one on Windows 10. So, I am assuming this may be the reason as to why I am the only one who's getting this.