I've got something like this DateTime.Now.ToString("dd.MM.yy");
In my code, And I need to add 1 week to it, like 5.4.2012
to become 12.4.2012
I tried to convert it to int and then add it up, but there is a problem when it's up to 30.
Can you tell me some clever way how to do it?
You want to leave it as a DateTime
until you are ready to convert it to a string.
DateTime.Now.AddDays(7).ToString("dd.MM.yy");
Sure!
DateTime.Now.AddDays(7).ToString("dd.MM.yy");
Any reason you can't use the AddDays method as in
DateTime.Now.AddDays(7)