KMime::DateFormatter Class Reference
class abstracting date formatting More...
#include <kmime_util.h>
Collaboration diagram for KMime::DateFormatter:

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 | |
QString | formatDate (DateFormatter::FormatType t, time_t time, const QString &data=QString::null, bool shortFormat=true, bool includeSecs=false) |
QString | formatCurrentDate (DateFormatter::FormatType t, const QString &data=QString::null, bool shortFormat=true, bool includeSecs=false) |
QCString | rfc2822FormatDate (time_t time) |
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"
Definition at line 186 of file kmime_util.h.
Constructor & Destructor Documentation
|
constructor
Definition at line 476 of file kmime_util.cpp. |
Member Function Documentation
|
returns the currently set format
Definition at line 486 of file kmime_util.cpp. |
|
sets the currently used format
Definition at line 492 of file kmime_util.cpp. |
|
returns formatted date string in a currently set format.
Definition at line 498 of file kmime_util.cpp. References cTime(), custom(), fancy(), isoDate(), and localized(). Referenced by formatCurrentDate(), and formatDate(). |
|
overloaded, does exactly what dateString does (it's slower)
Definition at line 522 of file kmime_util.cpp. |
|
makes the class use the custom format for date to string conversions. Method accepts the same arguments as QDateTime::toString method and adds "Z" expression which is substituted with the RFC-822 style numeric timezone (-0500)
Definition at line 563 of file kmime_util.cpp. Referenced by formatCurrentDate(), and formatDate(). |
|
returns rfc2822 formatted string
Definition at line 529 of file kmime_util.cpp. References zone(). Referenced by rfc2822FormatDate(). |
|
resets the internal clock
Definition at line 740 of file kmime_util.cpp. |
|
convenience function
Definition at line 746 of file kmime_util.cpp. References dateString(), and setCustomFormat(). |
|
convenience function, same as formatDate but returns the current time formatted
Definition at line 757 of file kmime_util.cpp. References dateString(), and setCustomFormat(). |
|
convenience function, same as rfc2822
Definition at line 768 of file kmime_util.cpp. References rfc2822(). |
|
returns fancy formatted date string
Definition at line 650 of file kmime_util.cpp. Referenced by dateString(). |
|
returns localized formatted date string
Definition at line 702 of file kmime_util.cpp. Referenced by dateString(). |
|
returns string as formatted with ctime function
Definition at line 725 of file kmime_util.cpp. Referenced by dateString(). |
|
returns a string in the "%Y-%m-%d %H:%M:%S" format
Definition at line 731 of file kmime_util.cpp. Referenced by dateString(). |
|
returns date formatted with the earlier given custom format
Definition at line 543 of file kmime_util.cpp. References zone(). Referenced by dateString(). |
|
returns a string identifying the timezone (eg."-0500")
Definition at line 577 of file kmime_util.cpp. |
The documentation for this class was generated from the following files: