KDE PIM / Developers / API Docs / libkmime

KMime::DateFormatter Class Reference

class abstracting date formatting More...

#include <kmime_util.h>

List of all members.

Public Types

Public Member Functions

Static Public Member Functions

Protected Member Functions


Detailed Description

class abstracting date formatting

DateFormatter deals with different kinds of date display formats. The formats supported by the class include:


Constructor & Destructor Documentation

KMime::DateFormatter::DateFormatter FormatType  fType = DateFormatter::Fancy  ) 
 

constructor

Parameters:
fType default format used by the class

Member Function Documentation

DateFormatter::FormatType KMime::DateFormatter::getFormat  )  const
 

returns the currently set format

void KMime::DateFormatter::setFormat FormatType  t  ) 
 

sets the currently used format

QString KMime::DateFormatter::dateString time_t  otime,
const QString &  lang = QString::null,
bool  shortFormat = true,
bool  includeSecs = false
const
 

returns formatted date string in a currently set format.

Parameters:
otime time to format
lang used only by the Localized format, sets the used language
shortFormat used only by the Localized format, is passed to KLocale::formatDateTime
includeSecs used only by the Localized format, is passed to KLocale::formatDateTime

QString KMime::DateFormatter::dateString const QDateTime &  dtime,
const QString &  lang = QString::null,
bool  shortFormat = true,
bool  includeSecs = false
const
 

overloaded, does exactly what

See also:
dateString does (it's slower)

void KMime::DateFormatter::setCustomFormat const QString &  format  ) 
 

makes the class use the custom format for date to string conversions.

Method accepts the same arguments as

See also:
QDateTime::toString method and adds "Z" expression which is substituted with the RFC-822 style numeric timezone (-0500)
Parameters:
format the custom format

QCString KMime::DateFormatter::rfc2822 time_t  otime  )  const
 

returns rfc2822 formatted string

Parameters:
otime time to use for formatting

void KMime::DateFormatter::reset  ) 
 

resets the internal clock

QString KMime::DateFormatter::formatDate DateFormatter::FormatType  t,
time_t  time,
const QString &  data = QString::null,
bool  shortFormat = true,
bool  includeSecs = false
[static]
 

convenience function

See also:
dateString
Parameters:
t specifies the FormatType to use
time time to format
data is either the format when FormatType is Custom, or language when FormatType is Localized
shortFormat used only by the Localized format, is passed to KLocale::formatDateTime
includeSecs used only by the Localized format, is passed to KLocale::formatDateTime

QString KMime::DateFormatter::formatCurrentDate DateFormatter::FormatType  t,
const QString &  data = QString::null,
bool  shortFormat = true,
bool  includeSecs = false
[static]
 

convenience function, same as

See also:
formatDate but returns the current time formatted
Parameters:
t specifies the FormatType to use
data is either the format when FormatType is Custom, or language when FormatType is Localized
shortFormat used only by the Localized format, is passed to KLocale::formatDateTime
includeSecs used only by the Localized format, is passed to KLocale::formatDateTime

QCString KMime::DateFormatter::rfc2822FormatDate time_t  time  )  [static]
 

convenience function, same as

See also:
rfc2822

QString KMime::DateFormatter::fancy time_t  otime  )  const [protected]
 

returns fancy formatted date string

Parameters:
otime time to format

QString KMime::DateFormatter::localized time_t  otime,
bool  shortFormat = true,
bool  includeSecs = false,
const QString &  localeLanguage = QString::null
const [protected]
 

returns localized formatted date string

Parameters:
otime time to format
shortFormat 
includeSecs 
localeLanguage language used for formatting

QString KMime::DateFormatter::cTime time_t  otime  )  const [protected]
 

returns string as formatted with ctime function

QString KMime::DateFormatter::isoDate time_t  otime  )  const [protected]
 

returns a string in the "%Y-%m-%d %H:%M:%S" format

QString KMime::DateFormatter::custom time_t  t  )  const [protected]
 

returns date formatted with the earlier given custom format

Parameters:
t time used for formatting

QCString KMime::DateFormatter::zone time_t  otime  )  const [protected]
 

returns a string identifying the timezone (eg."-0500")


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