If you run the code you give:
DateTime Dob = Convert.ToDateTime(TextBox2.Text);
Then "Dob" will contain the date in DateTime format - it can't hold anything else.
However, whenever you try to print it: to the console, or a label, or a textbox, or even view it in the debugger, there is an implicit call to the
ToString
method to make it work.
It is still stored in DateTime: Try replacing "Dob" with "Dob.Month" and you will see just the month appear.