UaDateTime Class Reference
[UA Base Library Classes]

Wrapper classs for the ua stack structure OpcUa_DateTime. Helper class for modifying UaDateTime elements. The UaDateTime class provides date and time functions. More...

#include <uadatetime.h>

List of all members.


Public Member Functions

 UaDateTime ()
 UaDateTime (const OpcUa_DateTime &)
virtual ~UaDateTime ()
 operator OpcUa_DateTime () const
bool operator< (const UaDateTime &other) const
bool operator> (const UaDateTime &other) const
bool operator== (const UaDateTime &other) const
bool operator!= (const UaDateTime &other) const
UaString toString () const
UaString toDateString () const
UaString toTimeString () const
time_t toTime_t () const
int msec () const
OpcUa_Boolean isNull () const
OpcUa_Int32 daysTo (const UaDateTime &) const
OpcUa_Int32 secsTo (const UaDateTime &) const
OpcUa_Int32 msecsTo (const UaDateTime &) const
void addSecs (int secs)
void addMilliSecs (int msecs)

Static Public Member Functions

static UaDateTime now ()
static UaDateTime fromString (const UaString &)
static UaDateTime fromTime_t (time_t tim)

Detailed Description

Wrapper classs for the ua stack structure OpcUa_DateTime. Helper class for modifying UaDateTime elements. The UaDateTime class provides date and time functions.

Constructor & Destructor Documentation

UaDateTime::UaDateTime (  ) 

construction

UaDateTime::UaDateTime ( const OpcUa_DateTime &  dateTime  ) 

construction

Parameters:
dateTime the actual date time

UaDateTime::~UaDateTime (  )  [virtual]

destruction


Member Function Documentation

UaDateTime::operator OpcUa_DateTime (  )  const

Get the UaDateTime.

Returns:
the UaDateTime.

bool UaDateTime::operator< ( const UaDateTime other  )  const

Operator for comparing.

Parameters:
other the UaDateTime to compare.
Returns:
true if smaler false if not.

bool UaDateTime::operator> ( const UaDateTime other  )  const

Operator for comparing.

Parameters:
other the UaDateTime to compare.
Returns:
true if bigger false if not.

bool UaDateTime::operator== ( const UaDateTime other  )  const

Compare variables if they are similar.

Parameters:
other the char to compare.
Returns:
true if not similar false if similar.

bool UaDateTime::operator!= ( const UaDateTime other  )  const

Returns true if other is not equal to this.

See also:
operator==
Parameters:
other the UaString to compare.
Returns:
true if other is not equal to this.

UaDateTime UaDateTime::now (  )  [static]

Get the Date and Time of now.

Returns:
the date and the time of now.

UaDateTime UaDateTime::fromString ( const UaString sTime  )  [static]

Get UaDateTime from string

Parameters:
sTime the string to convert.
Returns:
UaDateTime from string.

UaDateTime UaDateTime::fromTime_t ( time_t  tim  )  [static]

Get UaDateTime from time_t

Parameters:
tim the time_t struct to convert.
Returns:
UaDateTime from time_t.

UaString UaDateTime::toString (  )  const

Converts the UaDateTime into a UaString.

Returns:
the converted UaDateTime.

UaString UaDateTime::toDateString (  )  const

Convert a date to a string.

Returns:
the string of the date.

UaString UaDateTime::toTimeString (  )  const

Convert a time to a string.

Returns:
the string of the time.

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.

Returns:
unix timestamp format time_t.

int UaDateTime::msec (  )  const

Returns the milliseconds part of this dateTime.

Returns:
the milliseconds part of this dateTime.

OpcUa_Boolean UaDateTime::isNull (  )  const

Check wether UaDateTime is null or not.

Returns:
true if null false if not.

OpcUa_Int32 UaDateTime::daysTo ( const UaDateTime to  )  const

Get the days.

Parameters:
to the UaDateTime to convert.
Returns:
the days.

OpcUa_Int32 UaDateTime::secsTo ( const UaDateTime to  )  const

Get the seconds.

Parameters:
to the UaDateTime to convert.
Returns:
the seconds.

OpcUa_Int32 UaDateTime::msecsTo ( const UaDateTime to  )  const

Get the milliseconds.

Parameters:
to the UaDateTime to convert.
Returns:
the milliseconds.

void UaDateTime::addSecs ( int  secs  ) 

Adds seconds to the date time.

Parameters:
secs the seconds.

void UaDateTime::addMilliSecs ( int  msecs  ) 

Adds milli seconds to the date time.

Parameters:
msecs the millisecs.


The documentation for this class was generated from the following files:
  • src/uabase/uabasecpp/uadatetime.h
  • src/uabase/uabasecpp/uadatetime.cpp