$LastChangedDate: 27-Juil-2011 $

# CL_dat_cal2jd

Calendar date to Julian day

## Calling Sequence

       [jd] = CL_dat_cal2jd(year,month,day [,hour,minute,second])
       [jd] = CL_dat_cal2jd(cal) // cal=[year;month;day [;hour;minute;second]]

## Description

- Converts a calendar date into a Julian day.

- Notes:

  - Years are counted astronomically. The year 1-BC is 0, 2-BC is -1, ...

  - The dates are relative to the Julian calendar before 4th october 1582 24h (Julian calendar), and to the Gregorian calendar after 5th October 1582 0h (Julian calendar), that is, after 15th october 1582 0h (Gregorian calendar).

  - Julian day 0 is 1st January -4712 12h (Julian calendar)

- See Dates and Time for more details.

## Parameters

year:

  (integer) Year. (1xN)

month:

  (integer in [1,12]) Month. (1xN).

day:

  (integer in [1,31]) Day. (1xN)

hour:

  (optional) Hours. Default is 0. (1xN or 1x1)

minute:

  (optional) Minutes. Default is 0. (1xN or 1x1)

second:

  (optional) Seconds. Default is 0. (1xN or 1x1)

jd:

  Julian day (number of days since 1st January -4712, 12h) (1xN)

## Authors

- CNES - DCT/SB

## Bibliography

- 1) Jean Meeus - Astronomical Algorithms - 1991

- 2) IMCCE: http://www.imcce.fr

## See also

- CL_dat_jd2cal

- CL_dat_cal2cjd

## Examples

    // Example 1
    jd = CL_dat_cal2jd(2000,1,1)
    jd = CL_dat_cal2jd(2010,2,20,12,3,45)
    jd = CL_dat_cal2jd([2000;1;1])
    jd = CL_dat_cal2jd([2010;2;20;12;3;45])

    // Example 2
    year=[2000,2010]
    month=[1,2]
    day=[1,20]
    hour=[0,12]
    minute=[0,3]
    second=[0,45]
    jd = CL_dat_cal2jd(year,month,day,hour,minute,second)
    jd = CL_dat_cal2jd([year;month;day;hour;minute;second])