Error of datetime

Asked

Viewed 49 times

0

I’m taking a date of two different dateTimes and concatenating into one variable, but when I write the content of this variable is as follows:

Period: System.Windows.Forms.Datetimepicker, Value: 07/20/2017 15:52:45 Up to System.Windows.Forms.Datetimepicker, Value: 07/20/2017 15:52:45

 String dataTime = tempoInicialEXP.Text + " Até " + tempoFinalEXP.Text;

1 answer

1


you have to use the property Value of DateTimePicker:

Example:

tempoInicialEXP.Value.ToString();
tempoInicialEXP.Value.ToString("dd/MM/yyyy HH:mm");
tempoInicialEXP.Value.ToShortDateString();

Browser other questions tagged

You are not signed in. Login or sign up in order to post.