0.4.1
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

Definition at line 105 of file InsTime.hpp.

◆ 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

Definition at line 159 of file InsTime.hpp.

◆ 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

Definition at line 96 of file InsTime.hpp.

Variable Documentation

◆ DAYS_PER_WEEK

int32_t NAV::InsTimeUtil::DAYS_PER_WEEK
constexpr

Days / Week.

Definition at line 52 of file InsTime.hpp.

◆ DAYS_PER_YEAR

int32_t NAV::InsTimeUtil::DAYS_PER_YEAR
constexpr

Days / Year.

Definition at line 51 of file InsTime.hpp.

◆ DIFF_BDT_WEEK_TO_GPST_WEEK

int32_t NAV::InsTimeUtil::DIFF_BDT_WEEK_TO_GPST_WEEK
constexpr

BeiDou starts zero at 1-Jan-2006 and GPS starts 6-Jan-1980.

Definition at line 45 of file InsTime.hpp.

◆ DIFF_MJD_TO_JD_DAYS

int32_t NAV::InsTimeUtil::DIFF_MJD_TO_JD_DAYS
constexpr

Difference of the days between MJD and JD.

Definition at line 47 of file InsTime.hpp.

◆ DIFF_MJD_TO_JD_FRAC

long double NAV::InsTimeUtil::DIFF_MJD_TO_JD_FRAC
constexpr

Difference of the fraction between MJD and JD.

Definition at line 48 of file InsTime.hpp.

◆ DIFF_TO_1_1_1970_MJD

int32_t NAV::InsTimeUtil::DIFF_TO_1_1_1970_MJD
constexpr

01.01.1970 00:00:00 UTC in Modified Julian Date (UNIX epoch)

Definition at line 44 of file InsTime.hpp.

◆ DIFF_TO_6_1_1980_MJD

int32_t NAV::InsTimeUtil::DIFF_TO_6_1_1980_MJD
constexpr

06.01.1980 in Modified Julian Date

Definition at line 43 of file InsTime.hpp.

◆ END_OF_THE_CENTURY_MJD

int32_t NAV::InsTimeUtil::END_OF_THE_CENTURY_MJD
constexpr

Modified Julian Date of the end of the century (15.01.2954)

Definition at line 41 of file InsTime.hpp.

◆ 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)

Definition at line 67 of file InsTime.hpp.

◆ GPS_LEAP_SEC_MJD

std::array<int32_t, 20> NAV::InsTimeUtil::GPS_LEAP_SEC_MJD
constexpr

Maps GPS leap seconds to a time: array<mjd_day>, index + 1 is amount of leap seconds.

Definition at line 70 of file InsTime.hpp.

◆ HOURS_PER_DAY

int32_t NAV::InsTimeUtil::HOURS_PER_DAY
constexpr

Hours / Day.

Definition at line 53 of file InsTime.hpp.

◆ HOURS_PER_WEEK

int32_t NAV::InsTimeUtil::HOURS_PER_WEEK
constexpr

Hours / Week.

Definition at line 54 of file InsTime.hpp.

◆ MINUTES_PER_DAY

int32_t NAV::InsTimeUtil::MINUTES_PER_DAY
constexpr

Minutes / Day.

Definition at line 56 of file InsTime.hpp.

◆ MINUTES_PER_HOUR

int32_t NAV::InsTimeUtil::MINUTES_PER_HOUR
constexpr

Minutes / Hour.

Definition at line 55 of file InsTime.hpp.

◆ MINUTES_PER_WEEK

int32_t NAV::InsTimeUtil::MINUTES_PER_WEEK
constexpr

Minutes / Week.

Definition at line 57 of file InsTime.hpp.

◆ MONTHS_PER_YEAR

int32_t NAV::InsTimeUtil::MONTHS_PER_YEAR
constexpr

Months / Year.

Definition at line 50 of file InsTime.hpp.

◆ SECONDS_PER_DAY

int32_t NAV::InsTimeUtil::SECONDS_PER_DAY
constexpr

Seconds / Day.

Definition at line 60 of file InsTime.hpp.

◆ SECONDS_PER_HOUR

int32_t NAV::InsTimeUtil::SECONDS_PER_HOUR
constexpr

Seconds / Hour.

Definition at line 59 of file InsTime.hpp.

◆ SECONDS_PER_MINUTE

int32_t NAV::InsTimeUtil::SECONDS_PER_MINUTE
constexpr

Seconds / Minute.

Definition at line 58 of file InsTime.hpp.

◆ SECONDS_PER_WEEK

int32_t NAV::InsTimeUtil::SECONDS_PER_WEEK
constexpr

Seconds / Week.

Definition at line 61 of file InsTime.hpp.

◆ WEEKS_PER_GPS_CYCLE

int32_t NAV::InsTimeUtil::WEEKS_PER_GPS_CYCLE
constexpr

Weeks per GPS cycle.

Definition at line 42 of file InsTime.hpp.