using System; var today = DateTime.Now; var yesterday= today.AddDays(-1).ToString("yyyy-MM-dd"); Console.WriteLine("Yesterday's Date is {0}",yesterday);