Date
-
Difference between two dates .(MM/DD/YY) One date is given through Textbox are in the same format as System date. Other is just system date . I want to get date,month,year differences
The right way to do this is by converting to two DateTime objects, then apply whatever it is you need, e.g. subtract to get a TimeSpan. You should not operate on date strings yourself, use TryParse() instead. :)
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
-
Difference between two dates .(MM/DD/YY) One date is given through Textbox are in the same format as System date. Other is just system date . I want to get date,month,year differences
What Luc said, plus: Don't use TextBoxes for dates, use a DateTimePicker. Use ISO 8601-compliant formats -- YYYY-MM-DD.