UA Server SDK C++ Bundle
1.4.0.258
|
Wrapper class for the UA stack structure OpcUa_DateTime. More...
#include <uadatetime.h>
Public Member Functions | |
UaDateTime () | |
construction | |
UaDateTime (const OpcUa_DateTime &) | |
construction More... | |
virtual | ~UaDateTime () |
destruction | |
UaDateTime (const FILETIME &) | |
Construction with a FILETIME. More... | |
UaDateTime & | operator= (const FILETIME &) |
Assign a new time with a FILETIME. More... | |
operator FILETIME () const | |
Get the time as FILETIME. More... | |
UaDateTime (const OpcUa_Int64 &) | |
Construction with a OpcUa_Int64. More... | |
UaDateTime & | operator= (const OpcUa_Int64 &) |
Assign a new time with a OpcUa_Int64. More... | |
operator OpcUa_Int64 () const | |
Get the time as OpcUa_Int64. More... | |
operator OpcUa_DateTime () const | |
Get the UaDateTime. More... | |
bool | operator< (const UaDateTime &other) const |
Operator for comparing. More... | |
bool | operator> (const UaDateTime &other) const |
Operator for comparing. More... | |
bool | operator== (const UaDateTime &other) const |
Compare variables if they are similar. More... | |
bool | operator!= (const UaDateTime &other) const |
Returns true if other is not equal to this. More... | |
UaString | toString () const |
Converts the UaDateTime into a UaString. More... | |
UaString | toDateString () const |
Convert a date to a string. More... | |
UaString | toTimeString () const |
Convert a time to a string. More... | |
time_t | toTime_t () const |
Converts the UA DateTime to UNIX timestamp format time_t. More... | |
int | msec () const |
Returns the milliseconds part of this dateTime. More... | |
OpcUa_Boolean | isNull () const |
Check whether UaDateTime is null or not. More... | |
OpcUa_Int32 | daysTo (const UaDateTime &) const |
Get the days. More... | |
OpcUa_Int32 | secsTo (const UaDateTime &) const |
Get the seconds. More... | |
OpcUa_Int32 | msecsTo (const UaDateTime &) const |
Get the milliseconds. More... | |
void | addSecs (int secs) |
Adds seconds to the date time. More... | |
void | addMilliSecs (int msecs) |
Adds milliseconds to the date time. More... | |
void | copyTo (OpcUa_DateTime *copy) const |
void | toVariant (UaVariant &variant) const |
void | toVariant (OpcUa_Variant &variant) const |
void | toDataValue (UaDataValue &dataValue, OpcUa_Boolean updateTimeStamps) const |
void | toDataValue (OpcUa_DataValue &dataValue, OpcUa_Boolean updateTimeStamps) const |
Static Public Member Functions | |
static UaDateTime | now () |
Get the Date and Time of now. More... | |
static UaDateTime | fromString (const UaString &) |
Get UaDateTime from string in ISO 8601 format. More... | |
static UaDateTime | fromTime_t (time_t tim) |
Get UaDateTime from time_t. More... | |
Friends | |
UABASE_EXPORT UaDataStream & | operator<< (UaDataStream &, const UaDateTime &) |
define UaDataStream operators for UaDateTime. More... | |
UABASE_EXPORT UaDataStream & | operator>> (UaDataStream &, UaDateTime &) |
Wrapper class for the UA stack structure OpcUa_DateTime.
Helper class for modifying UaDateTime elements. The UaDateTime class provides date and time functions.
UaDateTime::UaDateTime | ( | const OpcUa_DateTime & | dateTime | ) |
construction
dateTime | the actual date time |
UaDateTime::UaDateTime | ( | const FILETIME & | fileTime | ) |
Construction with a FILETIME.
fileTime | The time as FILETIME. |
UaDateTime::UaDateTime | ( | const OpcUa_Int64 & | time | ) |
Construction with a OpcUa_Int64.
time | The time as OpcUa_Int64. |
void UaDateTime::addMilliSecs | ( | int | msecs | ) |
Adds milliseconds to the date time.
msecs | the milliseconds. |
void UaDateTime::addSecs | ( | int | secs | ) |
Adds seconds to the date time.
secs | the seconds. |
OpcUa_Int32 UaDateTime::daysTo | ( | const UaDateTime & | to | ) | const |
|
static |
Get UaDateTime from string in ISO 8601 format.
ISO 8601 string format is specified in the following form "YYYY-MM-DDThh:mm:ss" where:
sTime | the string to convert. |
|
static |
Get UaDateTime from time_t.
tim | the time_t struct to convert. |
OpcUa_Boolean UaDateTime::isNull | ( | ) | const |
Check whether UaDateTime is null or not.
int UaDateTime::msec | ( | ) | const |
Returns the milliseconds part of this dateTime.
OpcUa_Int32 UaDateTime::msecsTo | ( | const UaDateTime & | to | ) | const |
|
static |
Get the Date and Time of now.
UaDateTime::operator FILETIME | ( | ) | const |
Get the time as FILETIME.
UaDateTime::operator OpcUa_DateTime | ( | ) | const |
Get the UaDateTime.
UaDateTime::operator OpcUa_Int64 | ( | ) | const |
Get the time as OpcUa_Int64.
bool UaDateTime::operator!= | ( | const UaDateTime & | other | ) | const |
Returns true if other is not equal to this.
other | the UaString to compare. |
bool UaDateTime::operator< | ( | const UaDateTime & | other | ) | const |
Operator for comparing.
other | the UaDateTime to compare. |
UaDateTime & UaDateTime::operator= | ( | const FILETIME & | fileTime | ) |
Assign a new time with a FILETIME.
fileTime | The time as FILETIME. |
UaDateTime & UaDateTime::operator= | ( | const OpcUa_Int64 & | time | ) |
Assign a new time with a OpcUa_Int64.
time | The time as OpcUa_Int64. |
bool UaDateTime::operator== | ( | const UaDateTime & | other | ) | const |
Compare variables if they are similar.
other | the char to compare. |
bool UaDateTime::operator> | ( | const UaDateTime & | other | ) | const |
Operator for comparing.
other | the UaDateTime to compare. |
OpcUa_Int32 UaDateTime::secsTo | ( | const UaDateTime & | to | ) | const |
UaString UaDateTime::toDateString | ( | ) | const |
Convert a date to a string.
UaString UaDateTime::toString | ( | ) | const |
Converts the UaDateTime into a UaString.
time_t UaDateTime::toTime_t | ( | ) | const |
Converts the UA DateTime to UNIX timestamp format time_t.
Note: This format only has a precision of seconds. The ms part will be cut. Also the time range is different and goes from 1970-01-01 till 2038-01-18 on 32bit systems.
UaString UaDateTime::toTimeString | ( | ) | const |
Convert a time to a string.
|
friend |
define UaDataStream operators for UaDateTime.