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

>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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.