Is it possible to add dates in C#?
(DateTime.Today.ToLongDateString() + 10)
I tried this but it doesn't work.
Do you want to add days?
DateTime newDate = DateTime.Today.AddDays(10);
Note that you get a new DateTime back!
MSDN
Use DateTime.Today.AddDays(10)
or any of the other AddXXX functions on DateTime.
What is the unit of 10. If it is days; then
var todayPlus10Days = DateTime.Today.AddDays(10);
Use AddDays() method:
DateTime dt = DateTime.Today;
dt = dt.AddDays(10);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With