I have a code:
int MonthNow = System.DateTime.Now.Month;
int YearNow = System.DateTime.Now.Year;
int DayNow = System.DateTime.Now.Day;
How can I get yesterday and tomorrow day, month and year in C#?
Of course, I can just write:
DayTommorow = DayNow +1;
but it may happen that tomorrow is other month or year. Are there in C# built-in tools to find out yesterday and today?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…