next up previous
Next: SLA_CC2S - Cartesian to Spherical
Up: SUBPROGRAM SPECIFICATIONS
Previous: SLA_CALDJ - Calendar Date to MJD

SLA_CALYD - Calendar to Year, Day   

ACTION:
Gregorian calendar date to year and day in year, in a Julian calendar aligned to the 20th/21st century Gregorian calendar, with century default.

CALL:
CALL sla_CALYD (IY, IM, ID, NY, ND, J)

GIVEN:

IY,IM,ID I year, month, day in Gregorian calendar: year may optionally omit the century

RETURNED:

NY I year (re-aligned Julian calendar)
ND I day in year (1 = January 1st)
J I status:
0 = OK
1 = bad year (before -4711)
2 = bad month
3 = bad day

NOTES:
1.
This routine supports the century default feature. Acceptable years are:
  • 00-49, interpreted as 2000-2049,
  • 50-99, interpreted as 1950-1999, and
  • other years after -4712 , interpreted literally.
Use sla_CLYD for years before 100AD.
2.
The purpose of sla_CALDJ is to support sla_EARTH, sla_MOON and sla_ECOR.
3.
Between 1900 March 1 and 2100 February 28 it returns answers which are consistent with the ordinary Gregorian calendar. Outside this range there will be a discrepancy which increases by one day for every non-leap century year.
4.
When an invalid year or month is supplied (status J = 1 or J = 2) the results are not computed. When a day is supplied which is outside the conventional range (status J = 3) the results are computed.


next up previous
Next: SLA_CC2S - Cartesian to Spherical
Up: SUBPROGRAM SPECIFICATIONS
Previous: SLA_CALDJ - Calendar Date to MJD

SLALIB --- Positional Astronomy Library
Starlink User Note 67
P. T. Wallace
12 October 1999
E-mail:ptw@star.rl.ac.uk