TACL Reference Manual
Built-In Functions and Variables
HP NonStop TACL Reference Manual—429513-018
9-72
#COMPUTEJULIANDAYNO Built-In Function
#COMPUTEJULIANDAYNO Built-In Function
Use #COMPUTEJULIANDAYNO to convert a calendar date on or after January 1,
0001, to a Julian day number. A Julian day number is an integral number of days
elapsed since January 1, 4713 B.C.
year
is a four-digit number, from 1975 through 9999, representing the year.
month
is a number in the range 1 to 12 representing the month.
day
is a number in the range 1 to 31 representing the day of the month.
Result
#COMPUTEJULIANDAYNO returns a space-separated list of four numbers. The first
number is the Julian day number. If an error occurs, TACL sets the first number to -1.
The remaining three numbers are error flags that indicate range errors in the three
arguments. A flag is 0 if its matching argument (year, month, or day) is within the range
for the date element it specifies, or -1 if it is outside the range.
Considerations
•
Specifying 14 for the month or 87 for the day, for example, causes
#COMPUTEJULIANDAYNO to return a range error in the flag representing that
argument. Specifying 31 for a 30-day month or February 29 in a year other than a
leap year, for example, causes range errors for both month and day because
#COMPUTEJULIANDAYNO is unable to determine which field is actually in error.
•
For examples showing the use of time functions, see the TACL Programming
Guide.
Example
This example shows #COMPUTEJULIANDAYNO output:
29> #OUTPUT [#COMPUTEJULIANDAYNO 1994 3 31]
2449078 0 0 0
This example shows #COMPUTEJULIANDAYNO error output:
30> #OUTPUT [#COMPUTEJULIANDAYNO 1993 4 65]
-1 0 0 -1
#COMPUTEJULIANDAYNO year month day