Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding one month to a date
Message
 
 
To
31/10/2011 09:05:06
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01527671
Message ID:
01527673
Views:
45
>If ldDate is Date.Now, how come I add one month and it gives November 30, 2011?
>
>
>Dim ldDate As Date = Date.Now
>Dim lnMonth As Integer = 0
>ldDate = ldDate.AddMonths(lnMonth)
>
>
>We are the 31st. So, isn't adding one month should bounced it back to November 31st, 2011?

If there will be 31 days in Novemeber, it might have bounced there. Alas, there are only 30 days in the Gregorian Calendar.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform