What you see is a formatting issue, not a data issue. It really is 00:00:00, but, nevertheless, you convert it to a string, shows it as 12:00:00, presumably with implicit "s". Remember that DateTime does not actually have a format in it - it's just a date / time. You can format it accordingly, for example.
Console.WriteLine(a1.ToString("yyyy-MM-dd HH:mm:ss"));
All this aside, I highly recommend that you not create a DateTime this way. Personally, I prefer to use DateTime.TryParseExact or DateTime.ParseExact anyway, instead of using "any templates that the current culture prefers", but even if you want to Convert.ToDateTime using Convert.ToDateTime , it would be easier to do this once. and then use the Date property to get a DateTime with a time set to 0:
DateTime a1 = Convert.ToDateTime(txtStartDate.Text).Date;
Jon skeet
source share