source: trunk/MagicSoft/slalib/caldj.c@ 18162

Last change on this file since 18162 was 731, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#include "slalib.h"
2#include "slamac.h"
3void slaCaldj ( int iy, int im, int id, double *djm, int *j )
4/*
5** - - - - - - - - -
6** s l a C a l d j
7** - - - - - - - - -
8**
9** Gregorian calendar to Modified Julian Date.
10**
11** (Includes century default feature: use slaCldj for years
12** before 100AD.)
13**
14** Given:
15** iy,im,id int year, month, day in Gregorian calendar
16**
17** Returned:
18** *djm double Modified Julian Date (JD-2400000.5) for 0 hrs
19** *j int status:
20** 0 = ok
21** 1 = bad year (MJD not computed)
22** 2 = bad month (MJD not computed)
23** 3 = bad day (MJD computed)
24**
25** Acceptable years are 00-49, interpreted as 2000-2049,
26** 50-99, " " 1950-1999,
27** 100 upwards, interpreted literally.
28**
29** Called: slaCldj
30**
31** Last revision: 21 October 1993
32**
33** Copyright P.T.Wallace. All rights reserved.
34*/
35{
36 int ny;
37
38/* Default century if appropriate */
39 if ( ( iy >= 0 ) && ( iy <= 49 ) )
40 ny = iy + 2000;
41 else if ( ( iy >= 50 ) && ( iy <= 99 ) )
42 ny = iy + 1900;
43 else
44 ny = iy;
45
46/* Modified Julian Date */
47 slaCldj ( ny, im, id, djm, j );
48}
Note: See TracBrowser for help on using the repository browser.