c# - Convert DateTime -


this works:

testdatetime = datetime.parseexact("16/10/2010", "dd/mm/yyyy", null); 

this not:

string somedate = "16/10/2010"; testdatetime = datetime.parseexact(somedate, "dd/mm/yyyy", null); 

why??

both code snippets absolutely equivalent , should work/not work same. suspect value of somedate variable not think inside application. try debugging.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -