27 return ((year % 4) == 0) &&
28 (!(((year % 100) == 0) && ((year % 400) != 0)));
33 #define GREGORIAN_EPOCH 1721425.5 38 (365.0 * (year - 1.0)) +
39 floor((year - 1.0) / 4.0) +
40 (-floor((year - 1.0) / 100.0)) +
41 floor((year - 1.0) / 400.0) +
42 floor((((367.0 * month) - 362.0) / 12.0) +
75 if (year == 0 || month <= 0 || day <= 0 || hour < 0 || min < 0 || sec < 0)
79 (floor(sec + 60 * (min + 60 * hour) + 0.5) / 86400.0);
#define MTK_ERR_CODE_JUMP(code)
MTKt_status MtkCalToJulian(int year, int month, int day, int hour, int min, int sec, double *jd)
Convert calendar date to Julian date.
static int leap_gregorian(int year)
static double gregorian_to_jd(int year, int month, int day)