JULDAY $RSI/julday.pro
[Previous] [Next]
 NAME:
	JULDAY

 PURPOSE:
	Calculate the Julian Day Number for a given month, day, and year.
	This is the inverse of the library function CALDAT.
	See also caldat, the inverse of this function.

 CATEGORY:
	Misc.

 CALLING SEQUENCE:
	Result = JULDAY([[[[Month, Day, Year], Hour], Minute], Second])

 INPUTS:
	MONTH:	Number of the desired month (1 = January, ..., 12 = December).

	DAY:	Number of day of the month.

	YEAR:	Number of the desired year.Year parameters must be valid
               values from the civil calendar.  Years B.C.E. are represented
               as negative integers.  Years in the common era are represented
               as positive integers.  In particular, note that there is no
               year 0 in the civil calendar.  1 B.C.E. (-1) is followed by
               1 C.E. (1).

	HOUR:	Number of the hour of the day.

	MINUTE:	Number of the minute of the hour.

	SECOND:	Number of the second of the minute.

   Note: Month, Day, Year, Hour, Minute, and Second can all be arrays.
         The Result will have the same dimensions as the smallest array, or
         will be a scalar if all arguments are scalars.

 OPTIONAL INPUT PARAMETERS:
	Hour, Minute, Second = optional time of day.

 OUTPUTS:
	JULDAY returns the Julian Day Number (which begins at noon) of the
	specified calendar date.  If Hour, Minute, and Second are not specified,
	then the result will be a long integer, otherwise the result is a
	double precision floating point number.

 CALLED BY:
	CALENDAR, TIMEGEN
 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	Accuracy using IEEE double precision numbers is approximately
   1/10000th of a second, with higher accuracy for smaller (earlier)
   Julian dates.

 MODIFICATION HISTORY:
	Translated from "Numerical Recipies in C", by William H. Press,
	Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling.
	Cambridge University Press, 1988 (second printing).

	AB, September, 1988
	DMS, April, 1995, Added time of day.
   CT, April 2000, Now accepts vectors or scalars.