Time Shield Library 2.0.0
C++ library for working with time
Loading...
Searching...
No Matches
julian_conversions.hpp File Reference

Julian Date / MJD / JDN helpers using the proleptic Gregorian calendar. More...

Go to the source code of this file.

Namespaces

namespace  time_shield
 Main namespace for the Time Shield library.
 
namespace  time_shield::detail
 

Functions

jd_t time_shield::detail::gregorian_dmy_to_jd_unchecked (double day, int64_t month, int64_t year) noexcept
 
jdn_t time_shield::detail::gregorian_dmy_to_jdn_unchecked (int64_t day, int64_t month, int64_t year) noexcept
 
double time_shield::detail::day_fraction_from_hms (int hour, int minute, int second, int millisecond) noexcept
 
jd_t time_shield::fts_to_jd (fts_t ts) noexcept
 Convert Unix timestamp (floating seconds) to Julian Date (JD).
 
jd_t time_shield::ts_to_jd (ts_t ts) noexcept
 Convert Unix timestamp (seconds) to Julian Date (JD).
 
jd_t time_shield::gregorian_ymd_to_jd (year_t year, int month, int day, int hour=0, int minute=0, int second=0, int millisecond=0) noexcept
 Convert Gregorian date/time components to Julian Date (JD) using year-first order.
 
mjd_t time_shield::fts_to_mjd (fts_t ts) noexcept
 Convert Unix timestamp (floating seconds) to Modified Julian Date (MJD).
 
mjd_t time_shield::ts_to_mjd (ts_t ts) noexcept
 Convert Unix timestamp (seconds) to Modified Julian Date (MJD).
 
jdn_t time_shield::gregorian_ymd_to_jdn (year_t year, int month, int day) noexcept
 Convert Gregorian date to Julian Day Number (JDN) using year-first order.
 
bool time_shield::try_gregorian_ymd_to_jd (year_t year, int month, int day, int hour, int minute, int second, int millisecond, jd_t &out) noexcept
 Try converting Gregorian date/time components to Julian Date (JD) using year-first order.
 
bool time_shield::try_gregorian_ymd_to_jdn (year_t year, int month, int day, jdn_t &out) noexcept
 Try converting Gregorian date to Julian Day Number (JDN) using year-first order.
 

Detailed Description

Julian Date / MJD / JDN helpers using the proleptic Gregorian calendar.

JD epoch used here:

  • Unix epoch (1970-01-01 00:00:00 UTC) is JD 2440587.5

Notes:

  • JD and MJD are returned as double (jd_t/mjd_t).
  • These functions are intended for utility/analytics, not for high-precision astronomy.

Definition in file julian_conversions.hpp.