Posted By: Anonymous
I am trying to convert my string formatted value to date type with format
this.Text="22/11/2009"; DateTime date = DateTime.Parse(this.Text);
What is the problem ?
It has a second override which asks for
IFormatProvider. What is this? Do I need to pass this also? If Yes how to use it for this case?
What are the differences between
Both answers of Slaks and Sam are working for me, currently user is giving the input but this will be assured by me that they are valid by using maskTextbox.
Which answer is better considering all aspects like type saftey, performance or something you feel like
this.Text="22/11/2009"; DateTime date = DateTime.ParseExact(this.Text, "dd/MM/yyyy", null);