Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DateDiff() month issue
Message
De
04/10/2011 19:36:21
 
 
À
03/10/2011 21:07:00
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:
01525500
Message ID:
01525595
Vues:
36
>I have a date given such as August 5th, 2007. This is in the tdDate parameter.
>
>I have this code:
>
>
>lnMonth = DateDiff(DateInterval.Month, tdDate, Date.Now)
>
>
>It gives 50. How can it gives 50 if we do not have completed the 2nd month of this fifth year yet? Basically, four years have elapsed. So, that gives 48 months. Then, on September 5th, 2011, this moves it to 49. But, how could it have moved to 50 if we are not October 5th yet?

http://msdn.microsoft.com/en-us/library/b5xbyt6f%28v=VS.90%29.aspx

"...the return value for DateInterval.Month is calculated purely from the year and month parts of the arguments"

Day is not part of the calculation.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform