Time Shield Library 2.0.0
C++ library for working with time
Loading...
Searching...
No Matches
legacy_aliases.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2#pragma once
3#ifndef TIME_SHIELD_HEADER_ASTRONOMY_LEGACY_ALIASES_HPP_INCLUDED
4#define TIME_SHIELD_HEADER_ASTRONOMY_LEGACY_ALIASES_HPP_INCLUDED
5
8
10
11#if defined(TIME_SHIELD_ENABLE_LEGACY_ALIASES)
12
13namespace time_shield {
14
17 inline jd_t gregorian_to_jd(double day, int64_t month, int64_t year) noexcept {
19 }
20
24 uint32_t day,
25 uint32_t month,
26 uint32_t year,
27 uint32_t hour,
28 uint32_t minute,
29 uint32_t second = 0,
30 uint32_t millisecond = 0) noexcept {
32 static_cast<double>(day) + detail::day_fraction_from_hms(
33 static_cast<int>(hour),
34 static_cast<int>(minute),
35 static_cast<int>(second),
36 static_cast<int>(millisecond)),
37 static_cast<int64_t>(month),
38 static_cast<int64_t>(year));
39 }
40
43 inline jdn_t gregorian_to_jdn(uint32_t day, uint32_t month, uint32_t year) noexcept {
45 static_cast<int64_t>(day),
46 static_cast<int64_t>(month),
47 static_cast<int64_t>(year));
48 }
49
50} // namespace time_shield
51
52#endif // defined(TIME_SHIELD_ENABLE_LEGACY_ALIASES)
53
54#endif // TIME_SHIELD_HEADER_ASTRONOMY_LEGACY_ALIASES_HPP_INCLUDED
TIME_SHIELD_CONSTEXPR T year(ts_t ts=time_shield::ts())
Alias for year_of function.
uint64_t jdn_t
Julian Day Number (whole days since Julian epoch).
Definition types.hpp:57
double jd_t
Julian Date (days since -4713‑11‑24T12:00:00Z).
Definition types.hpp:55
jdn_t gregorian_dmy_to_jdn_unchecked(int64_t day, int64_t month, int64_t year) noexcept
double day_fraction_from_hms(int hour, int minute, int second, int millisecond) noexcept
jd_t gregorian_dmy_to_jd_unchecked(double day, int64_t month, int64_t year) noexcept
Main namespace for the Time Shield library.
jd_t gregorian_to_jd(double day, int64_t month, int64_t year) noexcept
Legacy day-first Gregorian Julian Date conversion.
jdn_t gregorian_to_jdn(uint32_t day, uint32_t month, uint32_t year) noexcept
Legacy day-first Gregorian Julian Day Number conversion.