|  | Home |

# QMailTimeStamp Class Reference

The QMailTimeStamp class manages message time stamps. More...

        #include <QMailTimeStamp>

- List of all members, including inherited members

## Public Types

enum | OutputFormat { Rfc2822, Rfc3501, Rfc3339 }

## Public Functions

| QMailTimeStamp ()
| QMailTimeStamp ( const QString & timeText )
| QMailTimeStamp ( const QDateTime & dateTime )
| ~QMailTimeStamp ()
bool | isNull () const
bool | isValid () const
QDateTime | toLocalTime () const
QString | toString ( OutputFormat format = Rfc2822 ) const
QDateTime | toUTC () const
bool | operator!= ( const QMailTimeStamp & other ) const
bool | operator< ( const QMailTimeStamp & other ) const
bool | operator<= ( const QMailTimeStamp & other ) const
bool | operator== ( const QMailTimeStamp & other ) const
bool | operator> ( const QMailTimeStamp & other ) const
bool | operator>= ( const QMailTimeStamp & other ) const

## Static Public Members

QMailTimeStamp | currentDateTime ()

## Detailed Description

The QMailTimeStamp class manages message time stamps.

QMailTimeStamp provides functions for creating and manipulating the time stamps of messages. QMailTimeStamp can be created from time stamp strings, or from QDateTime objects. The time stamp information can be extracted in UTC time, local time, or as a formatted string.

QMailTimeStamp maintains the timezone information of a time stamp, so it can be used to convert time stamp information between UTC time and localized time values.

See also QDateTime and QMailMessage.

## Member Type Documentation

### enum QMailTimeStamp::OutputFormat

This enum type is used to select a format for timestamp output.

Constant | Value | Description
--- | --- | ---
`QMailTimeStamp::Rfc2822` | `0` | The format used in SMTP message format; example: "Wed, 17 May 2006 20:45:00 +0100".
`QMailTimeStamp::Rfc3501` | `1` | The format used in IMAP message append; example: "17-May-2006 20:45:00 +0100".
`QMailTimeStamp::Rfc3339` | `2` | The format specified for future protocols (a variant of ISO 8601); example: "2006-05-17T20:45:00+01:00".

## Member Function Documentation

### QMailTimeStamp::QMailTimeStamp ()

Constructs a null QMailTimeStamp object. A null timestamp is invalid.

### QMailTimeStamp::QMailTimeStamp ( const QString & timeText )

Constructs a QMailTimeStamp object by parsing timeText.

### QMailTimeStamp::QMailTimeStamp ( const QDateTime & dateTime )

Constructs a QMailTimeStamp object from the given dateTime.

### QMailTimeStamp::~QMailTimeStamp ()

Destroys a QMailTimeStamp object.

### QMailTimeStamp QMailTimeStamp::currentDateTime () `[static]`

Returns a QMailTimeStamp object initialised to contain the current date and time, in the local time zone.

### bool QMailTimeStamp::isNull () const

Returns true if the timestamp has not been initialized to contain a value.

### bool QMailTimeStamp::isValid () const

Returns true if the timestamp is valid; otherwise returns false;

### QDateTime QMailTimeStamp::toLocalTime () const

Returns a QDateTime containing the time stamp converted to the local time zone.

### QString QMailTimeStamp::toString ( OutputFormat format = Rfc2822 ) const

Returns the time stamp information in the format specified by format.

### QDateTime QMailTimeStamp::toUTC () const

Returns a QDateTime containing the time stamp in UTC time.

### bool QMailTimeStamp::operator!= ( const QMailTimeStamp & other ) const

Returns true if this time stamp is different from other; otherwise returns false.

Two time stamps are different if either the date, the time, or the time zone components are different.

See also operator==().

### bool QMailTimeStamp::operator< ( const QMailTimeStamp & other ) const

Returns true if this time stamp is earlier than other; otherwise returns false.

### bool QMailTimeStamp::operator<= ( const QMailTimeStamp & other ) const

Returns true if this time stamp is earlier than or equal to other; otherwise returns false.

### bool QMailTimeStamp::operator== ( const QMailTimeStamp & other ) const

Returns true if this time stamp is equal to other; otherwise returns false.

See also operator!=().

### bool QMailTimeStamp::operator> ( const QMailTimeStamp & other ) const

Returns true if this time stamp is later than other; otherwise returns false.

### bool QMailTimeStamp::operator>= ( const QMailTimeStamp & other ) const

Returns true if this time stamp is later than or equal to other; otherwise returns false.