I have the following for loop:
for (DateTime dateTime = FromDate; dateTime.CompareTo(ToDate) < 1; dateTime.AddDays(1)) { .. }
While debugging I see the dateTime.AddDays(1) is executed but doesn’t change the dateTime.
Any predictable reason ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
AddDays method returns a new date, so you should have something like this:
dateTime=dateTime.AddDays(1)