I have date that I get from Date Time Picker for example string date1 = dateTimePicker1.Value.ToString("yyyy-MM-dd"); It gives me 2017-12-23 Now I need previous date to save in date2 variable string date2 = "code for this"; // it should be 2017-12-22 Please help.
12/23/2017 11:38:20 AM
Salman Mushtaq2 Answers
New AnswerYou can use DateTime dt = new DateTime(year, month, day).AddDays(-1); And get day from it with specified format
Learn Playing. Play Learning
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message