PARM p1="!hpmonth" p2="!hpdate" p3="!hpyear" # doy.xeq - returns the day of the year from the date entered # EXAMPLE: # # :doy 12 22 2005 # DOY, TUE, SEP 22, 1998 # Day of year for 12/22/2005 is 356 echo !hpfile, !hpdatef SETVAR month ![UPS("!p1")] SETVAR day ![UPS("!p2")] SETVAR year ![LFT(RHT("!hpdatef",4),4-LEN("!p3"))+"!p3"] SETVAR doy_days ((month-1)*304/10)+((month+2)/10)+(((12-month)/10)*month) SETVAR doy_ly (1/(1+(year MOD 4)))-(1/(1+(year MOD 100))) SETVAR doy_ly (doy_ly+(1/(1+(year MOD 400))))*((7+month)/10) SETVAR doy_days doy_days+doy_ly+(day-1) ECHO Day of year for !month/!day/!year is !doy_days if not bound(traceon) then DELETEVAR doy_@ else showvar doy_@ endif