28 outputJD[0] = inputJD[0];
29 outputJD[1] = inputJD[1];
37 if (fabs(outputJD[1]) > fabs(outputJD[0]))
40 outputJD[0] = outputJD[1];
46 if ((remainder=fmod(outputJD[0],1.0)) != 0.5)
48 outputJD[0] = outputJD[0] - remainder + 0.5;
49 outputJD[1] = outputJD[1] + remainder - 0.5;
53 if (fabs(outputJD[1]) >= 1.0)
55 remainder=fmod(outputJD[1],1.0);
56 outputJD[0] += outputJD[1] - remainder;
57 outputJD[1] = remainder;
64 if ((outputJD[1] + 1.0) < 1.0)
85 l = julianDayNum + 68569;
87 l = l - (146097 * n + 3) / 4;
88 *year = (int)(4000 * (l + 1) / 1461001);
89 l = l - 1461 * (*year) / 4 + 31;
90 *month = (int)(80 * l / 2447L);
91 *day = (int)(l - 2447 * (*month) / 80);
93 *month = (int)(*month + 2 - 12 * l);
94 *year = (int)(100 * (n - 49) + *year + l);
125 double dayFractionSecs;
129 calday((
int)(jdUTC[0] + 0.5), &year, &month, &day);
133 hours = (int) (dayFractionSecs / 3600.0);
134 minutes = (int) ((dayFractionSecs - hours * 3600.0) / 60.0);
135 seconds = (dayFractionSecs - hours * 3600.0 - minutes * 60.0);
136 intSecs = (int) seconds;
137 fracSecs = (int) (fmod(dayFractionSecs,1.0) * 1.0e6);
145 calday((
int)(jdUTC[0] + 1.5), &year, &month, &day);
148 sprintf(utc_datetime,
"%04d-%02d-%02dT%02d:%02d:%02d.%06dZ", (
int)year,
149 (
int)month, (
int)day, hours, minutes, intSecs, fracSecs);
static void calday(int julianDayNum, int *year, int *month, int *day)
HDFFCLIBAPI _fcd _fcd intf * n
MTKt_status MtkUtcJdToUtc(double jdUTCin[2], char utc_datetime[MTKd_DATETIME_LEN])
Convert calendar date to Julian date.
#define MTKd_DATETIME_LEN
static double * JulianDateSplit(double inputJD[2], double outputJD[2])