FOUND
Loading...
Searching...
No Matches
time.hpp
1#ifndef SRC_COMMON_TIME_TIME_HPP_
2#define SRC_COMMON_TIME_TIME_HPP_
3
4#include <ctime>
5
6#include "common/decimal.hpp"
7
8namespace found {
9
10// Average Delta UT1 in seconds, based on USNO data
11#define AVG_DELTA_UT1 0.087497
12
17struct DateTime {
19 std::time_t epochs;
21 int year;
23 int month;
25 int day;
27 int hour;
29 int minute;
31 int second;
32};
33
40DateTime getUTCTime();
41
48DateTime getUT1Time();
49
59decimal getJulianDateTime(std::time_t epochs);
60
70decimal getJulianDateTime(DateTime &time);
71
78decimal getCurrentJulianDateTime();
79
90decimal getGreenwichMeanSiderealTime(std::time_t epochs);
91
103decimal getGreenwichMeanSiderealTime(DateTime &time);
104
112decimal getCurrentGreenwichMeanSiderealTime();
113
114} // namespace found
115
116#endif // SRC_COMMON_TIME_TIME_HPP_
DateTime represents a date and time.
Definition time.hpp:17
int year
Year (e.g., 2023)
Definition time.hpp:21
int hour
Hour of the day (0-23)
Definition time.hpp:27
std::time_t epochs
Seconds since epoch.
Definition time.hpp:19
int minute
Minute of the hour (0-59)
Definition time.hpp:29
int day
Day of the month (1-31)
Definition time.hpp:25
int second
Second of the minute (0-60)
Definition time.hpp:31
int month
Month (1-12)
Definition time.hpp:23