Log4Qt::DateTime Class Reference

The class DateTime provides extended functionality for QDateTime. More...

#include <datetime.h>

List of all members.

Public Member Functions

 DateTime ()
 DateTime (const QDateTime &rOther)
 DateTime (const QDate &rDate, const QTime &rTime, Qt::TimeSpec timeSpec=Qt::LocalTime)
DateTimeoperator= (const DateTime &rOther)
qint64 toMilliSeconds () const
QString toString (const QString &rFormat) const

Static Public Member Functions

static DateTime currentDateTime ()
static DateTime fromMilliSeconds (qint64 milliSeconds)


Detailed Description

The class DateTime provides extended functionality for QDateTime.

The class DateTime implements additional formatting options for toString() and provides conversion functions from and to milliseconds.


Constructor & Destructor Documentation

Log4Qt::DateTime::DateTime (  )  [inline]

Constructs a null date time.

See also:
QDateTime::QDateTime()

Referenced by currentDateTime(), and fromMilliSeconds().

Log4Qt::DateTime::DateTime ( const QDateTime &  rOther  )  [inline]

Constructs a copy of another QDateTime.

See also:
QDateTime::QDateTime(const QDateTime &rOther)

Log4Qt::DateTime::DateTime ( const QDate &  rDate,
const QTime &  rTime,
Qt::TimeSpec  timeSpec = Qt::LocalTime 
) [inline]

Constructs a datetime with the given rDate and rTime, using the time specification defined by timeSpec.

See also:
QDateTime::QDateTime(const QDate &rDate, const QTime &rTime, Qt::TimeSpec timeSpec = Qt::LocalTime)


Member Function Documentation

DateTime & Log4Qt::DateTime::operator= ( const DateTime rOther  )  [inline]

Assigns rOther to this DateTime and returns a reference to it.

qint64 Log4Qt::DateTime::toMilliSeconds (  )  const [inline]

Returns the datetime as the number of milliseconds that have passed since 1970-01-01T00:00:00,000, Coordinated Universal Time (Qt::UTC).

See also:
QDateTime::toTime_t()

QString Log4Qt::DateTime::toString ( const QString &  rFormat  )  const

Returns the datetime as a string. The rFormat parameter determines the format of the result string.

In addition to the expressions of QDateTime::toString(const QString &rFormat) the following expression can be used.

Expression Output
w the week of the year as number without a leading zero (1 to 53)
ww the week of the year as number with a leading zero (01 to 53)

Alternatively the rFormat parameter can specify one of the following strings.

String Format
ABSOLUTE uses the format HH:mm:ss.zzz
DATE uses the format dd MMM YYYY HH:mm:ss.zzzz
ISO8601 uses the format yyyy-MM-dd hh:mm:ss.zzz
NONE uses an empty string as format
RELATIVE returns the milliseconds since start of the program

See also:
QDateTime::toString(const QString &rFormat)

DateTime Log4Qt::DateTime::currentDateTime (  )  [inline, static]

Returns the current datetime, as reported by the system clock, in the local time zone.

See also:
QDateTime::currentDateTime()

References DateTime().

DateTime Log4Qt::DateTime::fromMilliSeconds ( qint64  milliSeconds  )  [inline, static]

Returns a datetime whose date and time are the number of milliseconds that have passed since 1970-01-01T00:00:00, Coordinated Universal Time (Qt::UTC).

See also:
QDateTime::fromTime_t(uint seconds)

References DateTime().


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

Generated on Sun Mar 1 16:40:45 2009 for Log4Qt by  doxygen 1.5.6