0.3.0
Loading...
Searching...
No Matches
NAV::InsTimeUtil Namespace Reference

Utility Namespace for Time related tasks. More...

Functions

constexpr int32_t daysInMonth (int32_t month, int32_t year)
 Returns the number of days in the specified month of the year.
 
constexpr std::string formatDuration (double seconds, size_t digits=9)
 Formats a duration given in seconds into days, hours, minutes and seconds.
 
constexpr bool isLeapYear (int32_t year)
 Returns true if the provided year is a leap year, false otherwise.
 

Variables

constexpr int32_t DAYS_PER_WEEK
 Days / Week.
 
constexpr int32_t DAYS_PER_YEAR
 Days / Year.
 
constexpr int32_t DIFF_BDT_WEEK_TO_GPST_WEEK
 BeiDou starts zero at 1-Jan-2006 and GPS starts 6-Jan-1980.
 
constexpr int32_t DIFF_MJD_TO_JD_DAYS
 Difference of the days between MJD and JD.
 
constexpr long double DIFF_MJD_TO_JD_FRAC
 Difference of the fraction between MJD and JD.
 
constexpr int32_t DIFF_TO_1_1_1970_MJD
 01.01.1970 00:00:00 UTC in Modified Julian Date (UNIX epoch)
 
constexpr int32_t DIFF_TO_6_1_1980_MJD
 06.01.1980 in Modified Julian Date
 
constexpr int32_t END_OF_THE_CENTURY_MJD
 Modified Julian Date of the end of the century (15.01.2954)
 
constexpr long double EPSILON
 
constexpr std::array< int32_t, 20 > GPS_LEAP_SEC_MJD
 Maps GPS leap seconds to a time: array<mjd_day>, index + 1 is amount of leap seconds.
 
constexpr int32_t HOURS_PER_DAY
 Hours / Day.
 
constexpr int32_t HOURS_PER_WEEK
 Hours / Week.
 
constexpr int32_t MINUTES_PER_DAY
 Minutes / Day.
 
constexpr int32_t MINUTES_PER_HOUR
 Minutes / Hour.
 
constexpr int32_t MINUTES_PER_WEEK
 Minutes / Week.
 
constexpr int32_t MONTHS_PER_YEAR
 Months / Year.
 
constexpr int32_t SECONDS_PER_DAY
 Seconds / Day.
 
constexpr int32_t SECONDS_PER_HOUR
 Seconds / Hour.
 
constexpr int32_t SECONDS_PER_MINUTE
 Seconds / Minute.
 
constexpr int32_t SECONDS_PER_WEEK
 Seconds / Week.
 
constexpr int32_t WEEKS_PER_GPS_CYCLE
 Weeks per GPS cycle.
 

Detailed Description

Utility Namespace for Time related tasks.

Function Documentation

◆ daysInMonth()

int32_t NAV::InsTimeUtil::daysInMonth ( int32_t month,
int32_t year )
constexpr

Returns the number of days in the specified month of the year.

Parameters
[in]monthMonth [1-12]
[in]yearYear to determine the leap year
Returns
Number of days in the specified month

◆ formatDuration()

std::string NAV::InsTimeUtil::formatDuration ( double seconds,
size_t digits = 9 )
constexpr

Formats a duration given in seconds into days, hours, minutes and seconds.

Parameters
[in]secondsAmount of seconds
[in]digitsDigits to round the seconds to
Returns
Formatted string of the duration

◆ isLeapYear()

bool NAV::InsTimeUtil::isLeapYear ( int32_t year)
constexpr

Returns true if the provided year is a leap year, false otherwise.

Parameters
[in]yearThe year to check
Returns
True if the year is a leap year, otherwise false

Variable Documentation

◆ EPSILON

long double NAV::InsTimeUtil::EPSILON
constexpr

Numerical precision/epsilon for 'long double' variables

  • Linux/x64: 1e-19
  • Windows/x64 1e-16
  • Linux/armv8: 1e-34 (Epsilon reports too small precision. Real precision is only approx. 1e-17)