General .NETFor general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category.
** PLEASE BE SPECIFIC WITH YOUR QUESTION **
When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Hi
How to compare the date entered in the textbox having format dd/mm/yyyy with system date in .Net.I have to validate the date with system date so that the user should not be allowed to enter the date less than system date.My date format is dd/mm/yyyy.
Hi
DateTime.Now will get you the system date.Properties like Month,Year,Day will give you the system date's month,day,year.You can check the entered date by extracting portions of the date(dd,mm,yyyy) with the system date's month,day,year..
I am getting the system date in dd/mm/yyyy format but how to compare that with the entered date.I have to compare that the entered date must not be less than system date.
One way is you can extract the portion of the day,month and year of both the dates and you can check..
Second way is convert the entered date to DateTime and use the DateTime.CompareTo function to check the entered date is less than System date.
Ex. result = Entererdate.CompareTo(SystemDate) .if result is less than 0,then entereddate is lesser.