4 int eraDtf2d(
const char *scale,
int iy,
int im,
int id,
5 int ihr,
int imn,
double sec,
double *d1,
double *d2)
82 int js, iy2, im2, id2;
83 double dj, w, day, seclim, dat0, dat12, dat24, dleap,
time;
95 if ( ! strcmp(scale,
"UTC") ) {
98 js =
eraDat(iy, im,
id, 0.0, &dat0);
99 if ( js < 0 )
return js;
102 js =
eraDat(iy, im,
id, 0.5, &dat12);
103 if ( js < 0 )
return js;
106 js =
eraJd2cal ( dj, 1.5, &iy2, &im2, &id2, &w);
108 js =
eraDat(iy2, im2, id2, 0.0, &dat24);
109 if ( js < 0 )
return js;
112 dleap = dat24 - (2.0*dat12 - dat0);
116 if ( ihr == 23 && imn == 59 ) seclim += dleap;
122 if ( ihr >= 0 && ihr <= 23 ) {
123 if ( imn >= 0 && imn <= 59 ) {
125 if ( sec >= seclim ) {
137 if ( js < 0 )
return js;
140 time = ( 60.0 * ( (double) ( 60 * ihr + imn ) ) + sec ) / day;
int eraDtf2d(const char *scale, int iy, int im, int id, int ihr, int imn, double sec, double *d1, double *d2)
int eraJd2cal(double dj1, double dj2, int *iy, int *im, int *id, double *fd)
int eraDat(int iy, int im, int id, double fd, double *deltat)
Warning because the service this data corrsponds to might have been last updated longer ago than Local time
int eraCal2jd(int iy, int im, int id, double *djm0, double *djm)