Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Handling Dates Beginning of Month and End of Month
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01512731
Message ID:
01512790
Vues:
51
>We know that February's numbers of days varies from 28 to 29 depending on if the year is a leap year.If you want to get the ending date of a month and don't want to deal with determining the leap year, how would you do this?
>
>Cecil

My functions:
ldDate = DATE(2012,02,01)

? BoM(ldDate)
? EoM(ldDate)
? NDoM(ldDate)

*-- Begin of month
FUNCTION BoM(tdFecha)
  RETURN DATE(YEAR(tdFecha),MONTH(tdFecha),1)
ENDFUNC

*-- End of month
FUNCTION EoM(tdFecha)
  LOCAL ld
  ld = GOMONTH(tdFecha,1)
  RETURN ld - DAY(ld)
ENDFUNC

*-- Number of days of the month
FUNCTION NDoM(tdFecha)
  LOCAL ld
  ld = GOMONTH(tdFecha,1)
  RETURN DAY(ld - DAY(ld))
ENDFUNC
Luis María Guayán
Tucumán, Argentina
________________________________
SysOp de www.PortalFox.com
Nada corre como un zorro
________________________________
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform