Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lowdown on Julian date
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00188463
Message ID:
00188562
Vues:
27
Rich,

You can get rid of the loop if you simply subtract Jan 1 from the date and add 1. Subtrarcting two dates will give you the number of days difference.

>The Julian daynumber (I think) is the type of number you were expecting with year plus days-in-year, e.g. - 1999048 for today. I don't think there's a function to return this number within native VFP commands and functions, but it'd be awfully easy to write. Something like:
>
FUNCTION JulDayNum
>LPARAMETER ldDate
>LOCAL lnRetVal, lnMonthNum
>IF TYPE(ldDate) != 'D'	&& May also want to accept D/T
>	RETURN 0	&& zero
>ENDIF
>lnRetVal = YEAR(m.ldDate)*1000
>FOR lnMonthNum = 1 TO MONTH(m.ldDate) - 1
>	* Add number of days for each month from an array
>ENDFOR
>lnRetVal = m.lnRetVal + DAY(m.ldDate)
>RETURN m.lnRetVal
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform