commonlib
GPSTimeUTC Class Reference

Public Member Functions

 GPSTimeUTC ()
 Constructs GPSTimeUTC with week and seconds equal to zero.
 
 GPSTimeUTC (const GPSTime &gpsTime, double leapSeconds)
 Constructs GPSTimeUTC at GPSTime with leap seconds. More...
 
 GPSTimeUTC (int32_t week, double seconds)
 Constructs GPSTimeUTC at with week and seconds of week value. More...
 
 GPSTimeUTC (double dateTime)
 Constructs GPSTimeUTC from Delphi TDateTime value which is defined as double type. More...
 
 GPSTimeUTC (const UTCTime &time)
 Constructs GPSTimeUTC with the utc time represented by UTCTime object. More...
 
int32_t getWeek () const
 Week since 06-Jan-1980 UTC according to UTC. More...
 
double getSeconds () const
 Seconds of GPS week according to UTC. More...
 
double getDateTimeValue () const
 UTC days since 30-Dec-1899 UTC, fractional part represents ratio of day. More...
 
int64_t getUnixTimeValue () const
 Integer number of seconds since start of Unix time on 01-Jan-1970 UTC. More...
 

Static Public Member Functions

static double RelativeSecondsBetween (const GPSTimeUTC &start, const GPSTimeUTC &end)
 Calculates relative seconds between two GPS times UTC. More...
 
static GPSTimeUTC IncrementSeconds (const GPSTimeUTC &time, double secondsIncrement)
 Returns a GPSTimeUTC incremented by seconds. More...
 

Constructor & Destructor Documentation

◆ GPSTimeUTC() [1/4]

GPSTimeUTC::GPSTimeUTC ( const GPSTime &  gpsTime,
double  leapSeconds 
)

Constructs GPSTimeUTC at GPSTime with leap seconds.

Seconds can be negative or have an absolute value greater than number of seconds in week. The internal values are going to be corrected so that seconds are positive and less than seconds in week. On 29 July 2019 UTC time was 18 seconds behind GPS time. To properly construct GPSTimeUTC -18 had to be passed as leap second value.

Parameters
gpsTimevalue
leapSecondsdifference between GPS time UTC and GPS time

◆ GPSTimeUTC() [2/4]

GPSTimeUTC::GPSTimeUTC ( int32_t  week,
double  seconds 
)

Constructs GPSTimeUTC at with week and seconds of week value.

Seconds can be negative or have an absolute value greater than number of seconds in week. The internal values are going to be corrected so that seconds are positive and less than seconds in week.

Parameters
weekvalue of weeks since 06-Jan-1980 UTC
secondsvalue of seconds from week

◆ GPSTimeUTC() [3/4]

GPSTimeUTC::GPSTimeUTC ( double  dateTime)
explicit

Constructs GPSTimeUTC from Delphi TDateTime value which is defined as double type.

It is equal to number of days since 30-Dec-1899 UTC. Fractional part is defined as ratio of day.

Parameters
dateTimevalue of days since 30-Dec-1899 UTC.

◆ GPSTimeUTC() [4/4]

GPSTimeUTC::GPSTimeUTC ( const UTCTime &  time)
explicit

Constructs GPSTimeUTC with the utc time represented by UTCTime object.

Parameters
timeUTCTime object.

Member Function Documentation

◆ getDateTimeValue()

double GPSTimeUTC::getDateTimeValue ( ) const

UTC days since 30-Dec-1899 UTC, fractional part represents ratio of day.

Returns
number of days

◆ getSeconds()

double GPSTimeUTC::getSeconds ( ) const

Seconds of GPS week according to UTC.

Returns
seconds of week

◆ getUnixTimeValue()

int64_t GPSTimeUTC::getUnixTimeValue ( ) const

Integer number of seconds since start of Unix time on 01-Jan-1970 UTC.

Returns
integer number of UTC seconds

◆ getWeek()

int32_t GPSTimeUTC::getWeek ( ) const

Week since 06-Jan-1980 UTC according to UTC.

Returns
week since 06-Jan-1980 UTC

◆ IncrementSeconds()

static GPSTimeUTC GPSTimeUTC::IncrementSeconds ( const GPSTimeUTC &  time,
double  secondsIncrement 
)
static

Returns a GPSTimeUTC incremented by seconds.

Parameters
timeGPSTimeUTC value
secondsIncrementdouble seconds incremented to time
Returns
GPSTimeUTC equal to passed time incremented by secondsIncrement

◆ RelativeSecondsBetween()

static double GPSTimeUTC::RelativeSecondsBetween ( const GPSTimeUTC &  start,
const GPSTimeUTC &  end 
)
static

Calculates relative seconds between two GPS times UTC.

Parameters
startGPSTimeUTC value
endGPSTimeUTC value
Returns
relative seconds between two GPS times UTC

The documentation for this class was generated from the following file: