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 is the significance of attaching a profile while creating a user?

751


What are directives in asp.net? List down all the important directives.

689


How do you do Client-side validation in .Net?

812


Define the steps to set up validation control.

762


Can you explain how ASP.NET application life cycle and page life cycle events fire?

779


What does aspcompat="true" mean?

752


What are sessions used for?

754


What is the file through which you can customize your asp.net application?

753


Why asp.net is better than php?

683


Where are session variables stored?

710


How do you create a master page?

762


What are the events that happen when a client requests an asp.net page from iis server?

680


Explain the different types of directives in .net?

698


What is difference cookie and session?

726


Write a code for sending an email from asp.net application.

756