Home » FAQ » ASP.NET » TextBox » How to convert TextBox value into a DateTime variable
VB.NET
Dim dt As DateTime = DateTime.Parse(TextBox1.Text)
C#
DateTime dt = DateTime.Parse(TextBox1.Text);
By default Date.Parse check the date as MDY format Refer DateTime.Parse for a specified Date Format.
Platform BlazorASP.NETWinFormsWPF.NET MAUI
Question *
Answer (Optional)
Email (Optional)
Email address is only for further clarification on your FAQ request. It will not be used for any other purpose.
Please leave this field empty.
Share with