Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP:NET
hi,
 
I am using AddMonths(); method to add some month in existing date, it add month correctly if the existing month is not December if am trying to add 1 month in December it didn't add month.
 
How can i add the month in december
Posted 16-Dec-12 19:15pm
Comments
Vani Kulkarni at 17-Dec-12 1:25am
   
Please elaborate. Your question is unclear. How does addmonth work for one date and does not work for another?
Milind_T at 17-Dec-12 1:27am
   
It should come January ? What is your output ?
Pradeep_kaushik at 17-Dec-12 1:28am
   
it the same as is it no change is there

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

The following works fine :
DateTime.Now.AddMonths(1); // 2013-01-17
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 17 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100