Name

CL_dat_cal2cjd — Calendar date to CNES Julian Day

Calling Sequence

   [cjd] = CL_dat_cal2cjd(year[,month[,day[,hour[,minute[,second]]]]])
   
   

Description

  • This function converts a calendar date (year,month,day,hour,minute,second) to a Cnes Julian Date(number of fractionnal days since January 1st 1950).

    The fractional part of cjd (cjd-int(cjd)) gives the time of the day as a decimal fraction of one day with 0.5 representing midday UT.

    ATTENTION: this algorithm is only valid for dates before 28 February 2100, because of the calculation over the leap years (with modulo). With the taken margin, it accepts only dates before 01-01-2100 at 0 hours.

  • Last update : 27/6/2008

Parameters

year:

integer in [1950,2099] (1xN)

month:

(optional) integer in [1,12] (1xN) (default is 1)

day:

(optional) integer between 1 and 28, 29, 30 or 31 depending on the month of the year (1xN) (default is 1)

hour:

(optional) integer in [0,23] (1xN) (default is 0)

minute:

(optional) integer in [0,59] (1xN) (default is 0)

second:

(optional) real in [0,60) (1xN) (default is 0)

cjd:

Cnes Julian Date (number of fractionnal days since January 1st 1950) (1xN)

Authors

CNES - DCT/SB

See also

CL_dat_cal2jd, CL_dat_cjd2cal

Bibliography

1 CNES - MSLIB FORTRAN 90, Volume D (md_calend_julien)

Examples

// Example 1
cjd = CL_dat_cal2cjd(1968,2,29,0,0,0)  // february 29 1968

// Example 2
day = [29 5 28];
month = [2 4 2];
year = [1968 1980 1986];
hour = [0 12 4];
minute = [0 30 20];
second = [0 5 12];
cjd = CL_dat_cal2cjd(year,month,day,hour,minute,second);

[year2,month2,day2,hour2,minute2,second2] = CL_dat_cjd2cal(cjd);