20 #ifndef ANTKEEPER_PHYSICS_TIME_GREGORIAN_HPP
21 #define ANTKEEPER_PHYSICS_TIME_GREGORIAN_HPP
47 T
to_jd(
int year,
int month,
int day,
int hour,
int minute, T second, T utc)
49 T jdn =
static_cast<T
>((1461 * (year + 4800 + (month - 14) / 12)) / 4 + (367 * (month - 2 - 12 * ((month - 14) / 12))) / 12 - (3 * ((year + 4900 + (month - 14) / 12) / 100)) / 4 + day - 32075);
50 return jdn +
static_cast<T
>(hour - 12) / T(24) +
static_cast<T
>(minute) / T(1440) +
static_cast<T
>(second) / T(86400) - utc / T(24);
67 T
to_ut1(
int year,
int month,
int day,
int hour,
int minute, T second, T utc)
69 return physics::time::jd::to_ut1<T>(to_jd<T>(year, month, day, hour, minute, second, utc));
T to_jd(int year, int month, int day, int hour, int minute, T second, T utc)
Calculates the JD time from a Gregorian date and time.
T to_ut1(int year, int month, int day, int hour, int minute, T second, T utc)
Calculates the UT1 time from a Gregorian date and time.