QDateTime Class Reference


The QDateTime class combines QDate and QTime into a single class. (details) (complete member list)

#include <qdatetm.h>

Public Members

Static Public Members

Related Functions

(Note that these are not member functions.)

Detailed Description

The QDateTime class combines QDate and QTime into a single class.

QDateTime provides high precision date and time functions since it can work with all dates since September 14. 1752, with the resolution up to a microsecond.


Member Function Documentation

QDateTime::QDateTime ()

Constructs a null datetime (i.e. null date and null time).

QDateTime::QDateTime (const QDate &date)

Constructs a datetime with date date and null time (00:00:00.000).

QDateTime::QDateTime (const QDate &date, const QTime &time)

Constructs a datetime with date date and time time.

QDateTime QDateTime::addDays (long ndays) const

Returns the datetime plus ndays days.

QDateTime QDateTime::addSecs (long nsecs) const

Returns the datetime plus nsecs seconds.

QDateTime QDateTime::currentDateTime ()

Returns the current datetime.

See also: QDate::currentDate() and QTime::currentTime().

long QDateTime::daysTo (const QDateTime &dt) const

Returns the number of days between this datetime and dt.

bool QDateTime::operator!= (const QDateTime &dt) const

Returns the TRUE if this datetime is not equal to dt, otherwise FALSE.

bool QDateTime::operator< (const QDateTime &dt) const

Returns the TRUE if this datetime is before dt, otherwise FALSE.

bool QDateTime::operator<= (const QDateTime &dt) const

Returns the TRUE if this datetime is before or equal to dt, otherwise FALSE.

bool QDateTime::operator== (const QDateTime &dt) const

Returns the TRUE if this datetime is equal to dt, otherwise FALSE.

bool QDateTime::operator> (const QDateTime &dt) const

Returns the TRUE if this datetime is after dt, otherwise FALSE.

bool QDateTime::operator>= (const QDateTime &dt) const

Returns the TRUE if this datetime is equal to or after dt, otherwise FALSE.

long QDateTime::secsTo (const QDateTime &dt) const

Returns the number of seconds between this datetime and dt.

QString QDateTime::toString () const

Returns the datetime as a string. The string format is "Sat May 20 1995 03:40:13".


Related Functions

QDataStream & operator<< (QDataStream &s, const QDateTime &dt)

Writes the datetime dt to the stream s and returns a reference to s.

QDataStream & operator>> (QDataStream &s, QDateTime &dt)

Reads the datetime dt from the stream s and returns a reference to s.


This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.

It was generated from the following files:


Generated at 16:17, 1995/06/30 by the webmaster at Troll Tech