Is there an easy way to calculate how many days have passed since New Year's? I want to make sure it takes consideration of leap year too.
Yes, as a matter of fact there is. The Julian date is the number of days since a fixed point in history ... 14 September 1752 to be precise. Two VFOX functions will give you what you want.
Sys(11) Returns the Julian number of a specific date.
Sys(11,"01/01/98") Returns the Julian day number of January 1, 1998
Sys(1) Returns the Juilian number of the system date.
** Note both of these functions return the number as a character string so to get the number of days since the beginning of the year ...
nDays = Val(Sys(11,"01/01/98")) - Val(Sys(1))
Regards,
Jason Tryon
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage