C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » ASP.NET/Web Applications »

Convert string to Date


Posted Date: 24 Nov 2004    Resource Type: Articles    Category: ASP.NET/Web Applications
Author: Rajasekaran PonnusamyMember Level: Silver    
Rating: 1 out of 5Points: 5



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 !!!






Responses

Author: aa adsa    25 Nov 2004Member Level: Bronze   Points : 0
Good article.

Small but sweet!!!

Keep it up

Ashish


Author: Rajeev     03 Dec 2004Member Level: Silver   Points : 0
Small Article But very usefull


Author: Rajeev     03 Dec 2004Member Level: Silver   Points : 0
Small Article But very usefull Tip


Author: swathi    08 Dec 2004Member 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 2006Member Level: Bronze   Points : 0
Thanks Mr.Ponnusamy. u code helped me in time.

Thanks alot!!!!!!!

Hema



Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: RSA Encryption in C#
Previous Resource: Limit Column VB.NET Version
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET/Web Applications


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use