how i can show only current date excluding time in any textbox...
and how i found the difference of the date in asp.net

Recommended Answers

>how i can show only current date excluding time in any textbox...

Use ToShortDateString(), ToString("foramt") methods.

>and how i found the difference of the date in asp.net

Use TimeSpan type.

Jump to Post

All 4 Replies

>how i can show only current date excluding time in any textbox...

Use ToShortDateString(), ToString("foramt") methods.

>and how i found the difference of the date in asp.net

Use TimeSpan type.

TimeSpan ts= date1 - date2;

>how i can show only current date excluding time in any textbox...

Use ToShortDateString(), ToString("foramt") methods.

>and how i found the difference of the date in asp.net

Use TimeSpan type.

TimeSpan ts= date1 - date2;

thanks for reply....
but should i take the datatype of date1 and date2

>how i can show only current date excluding time in any textbox...

Use ToShortDateString(), ToString("foramt") methods.

>and how i found the difference of the date in asp.net

Use TimeSpan type.

TimeSpan ts= date1 - date2;

thanks for reply....
but what should i take the datatype of date1 and date2

>how i can show only current date excluding time in any textbox...

Use ToShortDateString(), ToString("foramt") methods.

>and how i found the difference of the date in asp.net

Use TimeSpan type.

TimeSpan ts= date1 - date2;

i having the code...

TimeSpan date1 = TimeSpan.Parse(TextBox1.Text);
TimeSpan date2 = TimeSpan.Parse(TextBox2.Text);
TimeSpan ts = date1 - date2;
Textbox3.Text=ts;

Textbox1 show the current date,
Textbox2 show the previous date,
and
Textbox3 show the difference of textbox1 and textbox2 as the above given code..

i'm gettin an error (input string not correct format)
any solution .....for the above

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.