knowL: Knowledge Libraries
Loading...
Searching...
No Matches
knowCore::Timestamp Class Reference

Public Member Functions

 Timestamp (NanoSeconds _ns)
 
bool isValid () const
 
cres_qresult< QDateTime > toQDateTime () const
 
cres_qresult< QString > toRdfLiteral () const
 
template<typename _unit_ >
cres_qresult< _unit_ > toLocal () const
 
template<typename _unit_ >
_unit_ toEpoch () const
 
bool operator< (const Timestamp &_rhs) const
 
bool operator<= (const Timestamp &_rhs) const
 
bool operator== (const Timestamp &_rhs) const
 
bool operator!= (const Timestamp &_rhs) const
 
bool operator> (const Timestamp &_rhs) const
 
bool operator>= (const Timestamp &_rhs) const
 
Timestamp operator+ (const Timestamp &_rhs) const
 
Timestampoperator+= (const Timestamp &_rhs)
 
Timestamp operator- (const Timestamp &_rhs) const
 
Timestamp operator* (const knowCore::BigNumber &_rhs) const
 
template<typename _unit_ >
Timestamp add (_unit_ _unit) const
 
template<typename _unit_ >
_unit_ intervalTo (const Timestamp &_time) const
 

Static Public Member Functions

static cres_qresult< TimestampfromEpoch (const QuantityNumber &_quantity)
 
static cres_qresult< TimestampfromRdfLiteral (const QString &_literal)
 
static Timestamp endOfTime ()
 
static Timestamp originOfTime ()
 
static Timestamp now ()
 
template<typename _unit_ >
static cres_qresult< TimestampfromLocal (_unit_ _value)
 
template<typename _Period_ >
requires details::is_ratio<_Period_>::value
static Timestamp fromEpoch (const std::chrono::duration< BigNumber, _Period_ > &_value)
 
template<typename _Rep_ , typename _Period_ >
requires (not std::is_same_v<_Rep_, knowCore::BigNumber> and details::is_ratio<_Period_>::value)
static Timestamp fromEpoch (const std::chrono::duration< _Rep_, _Period_ > &_value)
 
template<typename _unit_ >
static Timestamp fromEpoch (qint64 _value)
 
template<typename _unit_ >
static Timestamp fromEpoch (const knowCore::BigNumber &_value)
 
static Timestamp from (const QDateTime &_time)
 

Member Function Documentation

◆ endOfTime()

Timestamp Timestamp::endOfTime ( )
static

The end of time, aka infinite.

◆ fromEpoch()

cres_qresult< Timestamp > Timestamp::fromEpoch ( const QuantityNumber & _quantity)
static

Create a datetime from a quantity number. It will fails if _quantity is not expressed in a multiple of seconds.

◆ intervalTo()

template<typename _unit_ >
_unit_ knowCore::Timestamp::intervalTo ( const Timestamp & _time) const

Compute the interval of time between the current time and one given in arguments _time.

◆ originOfTime()

Timestamp Timestamp::originOfTime ( )
static

The origin of time, aka -infinite.

◆ toEpoch()

template<typename _unit_ >
_unit_ knowCore::Timestamp::toEpoch ( ) const
inline
Returns
the time stamp in _unit_, which can be QuantityNumber or NanoSeconds or MilliSeconds...

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