Subtract days from a DateTime
DateTime dateForButton = DateTime.Now.AddDays(-1);
That error usually occurs when you try to subtract an interval from DateTime.MinValue
or you want to add something to DateTime.MaxValue
(or you try to instantiate a date outside this min-max interval). Are you sure you're not assigning MinValue
somewhere?