+ 1
Get previous dates in sequence
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.
2 Respuestas
+ 4
You can use DateTime dt = new DateTime(year, month, day).AddDays(-1); And get day from it with specified format
+ 2
@DIma, thanks for solution.