KMime::DateFormatter Class Reference
class abstracting date formatting More...
#include <kmime_util.h>
Public Types
- enum FormatType {
CTime, Localized, Fancy, Iso,
Custom
}
Public Member Functions
- DateFormatter (FormatType fType=DateFormatter::Fancy)
- FormatType getFormat () const
- void setFormat (FormatType t)
- QString dateString (time_t otime, const QString &lang=QString::null, bool shortFormat=true, bool includeSecs=false) const
- QString dateString (const QDateTime &dtime, const QString &lang=QString::null, bool shortFormat=true, bool includeSecs=false) const
- void setCustomFormat (const QString &format)
- QString getCustomFormat () const
- QCString rfc2822 (time_t otime) const
- void reset ()
Static Public Member Functions
- static QString formatDate (DateFormatter::FormatType t, time_t time, const QString &data=QString::null, bool shortFormat=true, bool includeSecs=false)
- static QString formatCurrentDate (DateFormatter::FormatType t, const QString &data=QString::null, bool shortFormat=true, bool includeSecs=false)
- static QCString rfc2822FormatDate (time_t time)
- static bool isDaylight ()
Protected Member Functions
- QString fancy (time_t otime) const
- QString localized (time_t otime, bool shortFormat=true, bool includeSecs=false, const QString &localeLanguage=QString::null) const
- QString cTime (time_t otime) const
- QString isoDate (time_t otime) const
- QString custom (time_t t) const
- QCString zone (time_t otime) const
- time_t qdateToTimeT (const QDateTime &dt) const
Detailed Description
class abstracting date formattingDateFormatter deals with different kinds of date display formats. The formats supported by the class include:
- fancy "Today 02:08:35"
- ctime "Sun Mar 31 02:08:35 2002"
- localized "2002-03-31 02:08"
- iso "2002-03-31 02:08:35"
- rfc2822 "Sun, 31 Mar 2002 02:08:35 -0500"
- custom "whatever you like"
Constructor & Destructor Documentation
|
constructor
|
Member Function Documentation
|
returns the currently set format
|
|
sets the currently used format
|
|
returns formatted date string in a currently set format.
|
|
overloaded, does exactly what
|
|
makes the class use the custom format for date to string conversions. Method accepts the same arguments as
|
|
returns rfc2822 formatted string
|
|
resets the internal clock
|
|
convenience function
|
|
convenience function, same as
|
|
convenience function, same as
|
|
returns fancy formatted date string
|
|
returns localized formatted date string
|
|
returns string as formatted with ctime function
|
|
returns a string in the "%Y-%m-%d %H:%M:%S" format
|
|
returns date formatted with the earlier given custom format
|
|
returns a string identifying the timezone (eg. "-0500") |
The documentation for this class was generated from the following files:
- kmime_util.h
- kmime_util.cpp