You should do it this way if you want to receive yesterday and tomorrow at 00:00:00:
DateTime yesterday = DateTime.Today.AddDays(-1); DateTime tomorrow = DateTime.Today.AddDays(1);
Just remember that if you do it like this:
DateTime yesterday = DateTime.Now.AddDays(-1); DateTime tomorrow = DateTime.Now.AddDays(1);
then you will get the current time minus one day, not yesterday at 00:00:00.
Jo Smo Feb 05 '16 at 17:10 2016-02-05 17:10
source share