String to Date Value --------------------------------- For Example, TextBox1 has some string value in date format.You compare date and this string value. At that situation you use below code,
DateTime SubmitDate=new DateTime(); System.Globalization.CultureInfo culture = new CultureInfo("en-GB", true); if(TextBox1.Text.ToString() != "") { SubmitDate= DateTime.Parse(TextBox1.Text.ToString(), culture, DateTimeStyles.NoCurrentDateDefault); }
Now, you compare any date value to SubmitDate variable. For Example,
if (SubmitDate > DateTime.Now) Response.Write ("The Submission Date is Greater than Current Date");
Summary
Enjoy Programming !!!
|
| Author: aa adsa 25 Nov 2004 | Member Level: Bronze Points : 0 |
Good article.
Small but sweet!!!
Keep it up
Ashish
|
| Author: Rajeev 03 Dec 2004 | Member Level: Silver Points : 0 |
Small Article But very usefull
|
| Author: Rajeev 03 Dec 2004 | Member Level: Silver Points : 0 |
Small Article But very usefull Tip
|
| Author: swathi 08 Dec 2004 | Member Level: Bronze Points : 0 |
Thanks a lot. it helped me. Please do post such kind of quick tips. thanks once again
|
| Author: hema Ganesan 15 Sep 2006 | Member Level: Bronze Points : 0 |
Thanks Mr.Ponnusamy. u code helped me in time.
Thanks alot!!!!!!!
Hema
|