Hello Sir,
I'm trying to calculate the difference between two time variables.
The below code is used to find the difference.
The problem is I'm unable to calculate the difference for time periods like 10:00 PM and 1:00 AM, whereas differences for PM to PM and AM to PM is calculated.
The datatype used for time is nvarchar(50).
DateTime d1 = Convert.ToDateTime(txtTime.Text);
DateTime d8 = Convert.ToDateTime(TextBox1.Text);
TimeSpan ts = d8.Subtract(d1);
Please help me out where I'm doing wrong.
Thanks