TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ramya t
NA
130
6.8k
String was not recognized as a valid DateTime.
Apr 25 2016 4:50 AM
hi
I was trying to calculate differences between two dates which is getting from textboxes.
my code is,
protected void Button1_Click(object sender, EventArgs e)
{
DateTime a = Convert.ToDateTime(t1.Text);
DateTime b = Convert.ToDateTime(t2.Text);
System.TimeSpan d = b.Subtract(a);
System.TimeSpan d1 = b - a;
string c = (b - a).TotalDays.ToString();
t3.Text = c.ToString();
}
after clicking a button i am getting a error m as " String was not recognized as a valid DateTime.
"
Please help me to resolve this problem.
Reply
Answers (
10
)
System.outofMemory Exception
combobox