Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding one month to a date
Message
 
 
À
31/10/2011 09:05:06
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01527671
Message ID:
01527673
Vues:
46
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform