It turns out that DateTime.AddDays returns a new instance of DateTime instead of modifying the existing instance. This is because DateTime is immutable.
Bruce Ng's software development blog
An archive of solutions of programming problems I have faced in my career