ADTF  3.18.2
a_util::datetime Namespace Reference

Serves as component for date and time handling. More...

Classes

class  Date
 Date implementation representing a date consisting of year, month and day. More...
 
class  Time
 Time implementation representing a time of day (00:00:00,0 - 23:59:59,999999) More...
 
class  DateTime
 DateTime class representing both Date and Time. More...
 

Enumerations

enum  TimestampReference { MicroSecondsSinceJulianDateOrigin = 0 , MicroSecondsSinceUnixTimeOrigin = 1 }
 The reference point in time. More...
 

Functions

bool operator== (const Date &lhs, const Date &rhs)
 Compare two dates for equality. More...
 
bool operator!= (const Date &lhs, const Date &rhs)
 Compare two dates for inequality. More...
 
Date getCurrentLocalDate ()
 Retrieves the current date (hardware clock with respect to timezone). More...
 
Date getCurrentSystemDate ()
 Retrieves the current system date (in UTC format). More...
 
bool operator== (const Time &lhs, const Time &rhs)
 Compare two times for equality. More...
 
bool operator!= (const Time &lhs, const Time &rhs)
 Compare two times for inequality. More...
 
Time getCurrentLocalTime ()
 Get the current time (hardware clock with respect to timezone). More...
 
Time getCurrentSystemTime ()
 Get the current time (in UTC format). More...
 
bool operator== (const DateTime &lhs, const DateTime &rhs)
 Compare two date-time representations for equality. More...
 
bool operator!= (const DateTime &lhs, const DateTime &rhs)
 Compare two date-time representations for inequality. More...
 
DateTime getCurrentLocalDateTime ()
 Get the current date and time (hardware clock with respect to timezone). More...
 
DateTime getCurrentSystemDateTime ()
 Get the current date and time (in UTC format). More...
 

Detailed Description

Serves as component for date and time handling.

Enumeration Type Documentation

◆ TimestampReference

The reference point in time.

With this enum we define the reference point of a timestamp. Since the internal data structure uses Julian day as the starting point when counting the elapsed microseconds, with the help of this enum the reference can be changed when receiving a timestamp (i.e. DateTime::toTimestamp()) and be converted back to Julian day reference point when setting a timestamp (i.e. DateTime::set(timestamp_t, TimestampReference))

Enumerator
MicroSecondsSinceJulianDateOrigin 

Reference point in time is noon on Monday, January 1, 4713 BC (Julian day)

MicroSecondsSinceUnixTimeOrigin 

Reference point in time is midnight on Thursday, 1 January 1970 AC (Unix time)

Definition at line 292 of file workspace/conan/dev_essential/1.3.3/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/a_util/datetime/datetime.h.

Function Documentation

◆ getCurrentLocalDate()

Date a_util::datetime::getCurrentLocalDate ( )

Retrieves the current date (hardware clock with respect to timezone).

Returns
The current date.

◆ getCurrentLocalDateTime()

DateTime a_util::datetime::getCurrentLocalDateTime ( )

Get the current date and time (hardware clock with respect to timezone).

Returns
The current date and time.

◆ getCurrentLocalTime()

Time a_util::datetime::getCurrentLocalTime ( )

Get the current time (hardware clock with respect to timezone).

Returns
The current time.

◆ getCurrentSystemDate()

Date a_util::datetime::getCurrentSystemDate ( )

Retrieves the current system date (in UTC format).

Returns
The current date.

◆ getCurrentSystemDateTime()

DateTime a_util::datetime::getCurrentSystemDateTime ( )

Get the current date and time (in UTC format).

Returns
The current date and time.

◆ getCurrentSystemTime()

Time a_util::datetime::getCurrentSystemTime ( )

Get the current time (in UTC format).

Returns
The current time.

◆ operator!=() [1/3]

bool a_util::datetime::operator!= ( const Date lhs,
const Date rhs 
)

Compare two dates for inequality.

Parameters
[in]lhsLeft-hand side object
[in]rhsRight-hand side object
Returns
true if the date representations are not equal, false otherwise

◆ operator!=() [2/3]

bool a_util::datetime::operator!= ( const DateTime lhs,
const DateTime rhs 
)

Compare two date-time representations for inequality.

Parameters
[in]lhsLeft-hand side object
[in]rhsRight-hand side object
Returns
true if the date-time representations are not equal, false otherwise

◆ operator!=() [3/3]

bool a_util::datetime::operator!= ( const Time lhs,
const Time rhs 
)

Compare two times for inequality.

Parameters
[in]lhsLeft-hand side object
[in]rhsRight-hand side object
Returns
true if the time representations are not equal, false otherwise

◆ operator==() [1/3]

bool a_util::datetime::operator== ( const Date lhs,
const Date rhs 
)

Compare two dates for equality.

Parameters
[in]lhsLeft-hand side object
[in]rhsRight-hand side object
Returns
true if both date representations are equal, false otherwise

◆ operator==() [2/3]

bool a_util::datetime::operator== ( const DateTime lhs,
const DateTime rhs 
)

Compare two date-time representations for equality.

Parameters
[in]lhsLeft-hand side object
[in]rhsRight-hand side object
Returns
true if both date-time representations are equal, false otherwise

◆ operator==() [3/3]

bool a_util::datetime::operator== ( const Time lhs,
const Time rhs 
)

Compare two times for equality.

Parameters
[in]lhsLeft-hand side object
[in]rhsRight-hand side object
Returns
true if both time representations are equal, false otherwise