What is wrong with a line like this? DateTime.Parse(myString)

Answer Posted / soner gönül

- Different cultures uses different standard date and time formats. This overload can create ambiguous values for the same string in different cultures. Eg: What should "01/02/2016" parsed as? 1 February? 2 January? It depends.

- The Calendar used by CurrentCulture might not have this date and time because of it's boundries.

If anyone interested, I wrote an article in Turkish about that subject.

http://sonergonul.net/datetime-parse-string-kullanmayi-birakamaz-miyiz/

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What I need to create and run an asp.net application?

514


What is enableviewstate in asp net?

527


Why mvc is better than asp.net? : Asp.Net MVC

471


Why Unload event of MasterPage Calls first in ASP.net ?

588


What is the difference between asp.net and mvc?

586






What is tracing? Where is it used?

555


Difference between singleton and singlecall.

570


What is asp.net mvc? : asp.net mvc

550


Is viewstate enabled by default?

533


What are the options in ASP.NET to maintain state?

619


Tell me what is the request flow used for asp.net mvc framework? : asp.net mvc

551


What is the recommended approach for asp.net mvc to globally intercept exceptions? What other functionality can be implemented with the approach? : Asp.Net MVC

501


What are all the various Estimation Techniques available ?

653


How can we use Web API with ASP.NET Web Form?

650


What is a runtime version?

530