OTimeZone Class Reference
A very primitive class to convert time from one timezone to another and to localtime and time_t. More...
#include <otimezone.h>
Collaboration diagram for OTimeZone:

Public Types | |
| typedef QString | ZoneName |
Public Member Functions | |
| OTimeZone (const ZoneName &=ZoneName::null) | |
| virtual | ~OTimeZone () |
| bool | isValid () const |
| QDateTime | toLocalDateTime (const QDateTime &dt) |
| converts the QDateTime to a DateTime in the local timezone if QDateTime is 25th Jan and takes place in Europe/Berlin at 12h and the current timezone is Europe/London the returned time will be 11h. | |
| QDateTime | toUTCDateTime (const QDateTime &dt) |
| converts the QDateTime to UTC time | |
| QDateTime | fromUTCDateTime (time_t) |
| reads the time_t into a QDateTime using UTC as timezone! | |
| QDateTime | toDateTime (time_t) |
| converts the time_t to the time in the timezone | |
| QDateTime | toDateTime (const QDateTime &, const OTimeZone &timeZone) |
| converts the QDateTime from one timezone to this timeZone | |
| time_t | fromDateTime (const QDateTime &) |
| converts the date time into a time_t. | |
| time_t | fromUTCDateTime (const QDateTime &) |
| converts the datetime with timezone UTC | |
| QString | timeZone () const |
Static Public Member Functions | |
| OTimeZone | current () |
| OTimeZone | utc () |
Detailed Description
A very primitive class to convert time from one timezone to another and to localtime and time_t.
Definition at line 13 of file otimezone.h.
Member Typedef Documentation
|
|
Definition at line 15 of file otimezone.h. Referenced by OTimeZone(). |
Constructor & Destructor Documentation
|
|
Definition at line 62 of file otimezone.cpp. References ZoneName. Referenced by utc(). |
|
|
Definition at line 65 of file otimezone.cpp. |
Member Function Documentation
|
|
Definition at line 68 of file otimezone.cpp. |
|
|
converts the QDateTime to a DateTime in the local timezone if QDateTime is 25th Jan and takes place in Europe/Berlin at 12h and the current timezone is Europe/London the returned time will be 11h.
Definition at line 76 of file otimezone.cpp. References current(), and toDateTime(). |
|
|
converts the QDateTime to UTC time
Definition at line 79 of file otimezone.cpp. References toDateTime(), and utc(). |
|
|
reads the time_t into a QDateTime using UTC as timezone!
Definition at line 82 of file otimezone.cpp. References utcTime(). Referenced by ORecur::fromMap(), OEvent::fromMap(), OTodoAccessXML::load(), save(), and OEvent::toMap(). |
|
|
converts the time_t to the time in the timezone
Definition at line 85 of file otimezone.cpp. References utcTime(). Referenced by OEvent::endDateTimeInZone(), OEvent::fromMap(), save(), OEvent::startDateTimeInZone(), toLocalDateTime(), OEvent::toMap(), and toUTCDateTime(). |
|
||||||||||||
|
converts the QDateTime from one timezone to this timeZone
Definition at line 92 of file otimezone.cpp. References QString::latin1(), m_name, to_Time_t(), utc(), and utcTime(). |
|
|
converts the date time into a time_t. It takes the timezone into account Definition at line 97 of file otimezone.cpp. References to_Time_t(). |
|
|
converts the datetime with timezone UTC
Definition at line 100 of file otimezone.cpp. References to_Time_t(). |
|
|
Definition at line 103 of file otimezone.cpp. Referenced by OEvent::endDateTimeInZone(), save(), OEvent::startDateTimeInZone(), and toLocalDateTime(). |
|
|
Definition at line 108 of file otimezone.cpp. References OTimeZone(). Referenced by ORecur::fromMap(), OEvent::fromMap(), OTodoAccessXML::load(), save(), toDateTime(), and toUTCDateTime(). |
|
|
Definition at line 111 of file otimezone.cpp. Referenced by OEvent::endDateTimeInZone(), and OEvent::startDateTimeInZone(). |
The documentation for this class was generated from the following files:
