Safir SDK Core
Loading...
Searching...
No Matches
Safir::Time::TimeProvider Class Reference

The Time class contains functions to operate on time. More...

#include <Safir/Time/TimeProvider.h>

Static Public Member Functions

static SAFIR_HELPER_DLL_IMPORT Safir::Dob::Typesystem::Si64::Second GetUtcTime ()
 Get current UTC time.
 
static boost::posix_time::ptime ToLocalTime (const Safir::Dob::Typesystem::Si64::Second utcTime)
 Convert from UTC to local time.
 
static Safir::Dob::Typesystem::Si64::Second ToUtcTime (const boost::posix_time::ptime &localTime)
 Convert local time to UTC time.
 
static boost::posix_time::ptime ToPtime (const Safir::Dob::Typesystem::Si64::Second utcTime)
 Get specified UTC time in boost::posix_time::ptime representation.
 
static Safir::Dob::Typesystem::Si64::Second ToDouble (const boost::posix_time::ptime &utcTime)
 Convert specified UTC time to a Double.
 

Detailed Description

The Time class contains functions to operate on time.

Member Function Documentation

◆ GetUtcTime()

static SAFIR_HELPER_DLL_IMPORT Safir::Dob::Typesystem::Si64::Second Safir::Time::TimeProvider::GetUtcTime ( )
static

Get current UTC time.

Returns
Seconds and fraction since jan 1 1970 00:00

◆ ToDouble()

static Safir::Dob::Typesystem::Si64::Second Safir::Time::TimeProvider::ToDouble ( const boost::posix_time::ptime & utcTime)
static

Convert specified UTC time to a Double.

Parameters
[in]utcTime- The UTC time
Returns
Seconds and fraction since jan 1 1970 00:00

Referenced by Safir::Time::AceTimeConverter::ToAceTime().

Here is the caller graph for this function:

◆ ToLocalTime()

static boost::posix_time::ptime Safir::Time::TimeProvider::ToLocalTime ( const Safir::Dob::Typesystem::Si64::Second utcTime)
static

Convert from UTC to local time.

Parameters
[in]utcTime- The time in UTC
Returns
The local time

References ToPtime().

Here is the call graph for this function:

◆ ToPtime()

static boost::posix_time::ptime Safir::Time::TimeProvider::ToPtime ( const Safir::Dob::Typesystem::Si64::Second utcTime)
static

Get specified UTC time in boost::posix_time::ptime representation.

Parameters
[in]utcTime- The UTC time
Returns
The UTC time stored in a boost::posix_time::ptime object

Referenced by ToLocalTime(), and Safir::Time::AceTimeConverter::ToPtime().

Here is the caller graph for this function:

◆ ToUtcTime()

static Safir::Dob::Typesystem::Si64::Second Safir::Time::TimeProvider::ToUtcTime ( const boost::posix_time::ptime & localTime)
static

Convert local time to UTC time.

Parameters
[in]localTime- The local time
Returns
Seconds and fraction since jan 1 1970 00:00