Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OTimeZone Class Reference

#include </home/clem/local/src/opie/noncore/unsupported/libopie/pim/otimezone.h>

Collaboration diagram for OTimeZone:

Collaboration graph
[legend]
List of all members.

Public Types

typedef QString ZoneName

Public Member Functions

 OTimeZone (const ZoneName &=ZoneName::null)
virtual ~OTimeZone ()
bool isValid () const
QDateTime toLocalDateTime (const QDateTime &dt)
QDateTime toUTCDateTime (const QDateTime &dt)
QDateTime fromUTCDateTime (time_t)
QDateTime toDateTime (time_t)
QDateTime toDateTime (const QDateTime &, const OTimeZone &timeZone)
time_t fromDateTime (const QDateTime &)
time_t fromUTCDateTime (const QDateTime &)
QString timeZone () const

Static Public Member Functions

static OTimeZone current ()
static OTimeZone utc ()

Private Attributes

ZoneName m_name
Private * d

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

typedef QString OTimeZone::ZoneName
 

Definition at line 15 of file otimezone.h.


Constructor & Destructor Documentation

OTimeZone::OTimeZone const ZoneName = ZoneName::null  ) 
 

Definition at line 62 of file otimezone.cpp.

Referenced by utc().

OTimeZone::~OTimeZone  )  [virtual]
 

Definition at line 65 of file otimezone.cpp.


Member Function Documentation

OTimeZone OTimeZone::current  )  [static]
 

Definition at line 103 of file otimezone.cpp.

References str.

Referenced by OEvent::endDateTimeInZone(), ODateBookAccessBackend_XML::finalizeRecord(), OEvent::fromMap(), save(), OEvent::startDateTimeInZone(), toLocalDateTime(), and OEvent::toMap().

time_t OTimeZone::fromDateTime const QDateTime  ) 
 

converts the date time into a time_t. It takes the timezone into account

Definition at line 97 of file otimezone.cpp.

References m_name, and Opie::to_Time_t().

time_t OTimeZone::fromUTCDateTime const QDateTime  ) 
 

converts the datetime with timezone UTC

Definition at line 100 of file otimezone.cpp.

References Opie::to_Time_t().

QDateTime OTimeZone::fromUTCDateTime time_t   ) 
 

reads the time_t into a QDateTime using UTC as timezone!

Definition at line 82 of file otimezone.cpp.

References Opie::utcTime().

Referenced by ODateBookAccessBackend_XML::finalizeRecord(), ORecur::fromMap(), OEvent::fromMap(), OTodoAccessXML::load(), save(), and OEvent::toMap().

bool OTimeZone::isValid  )  const
 

Definition at line 68 of file otimezone.cpp.

References QString::isEmpty(), and m_name.

QString OTimeZone::timeZone  )  const
 

Definition at line 111 of file otimezone.cpp.

References m_name.

QDateTime OTimeZone::toDateTime const QDateTime ,
const OTimeZone timeZone
 

converts the QDateTime from one timezone to this timeZone

Definition at line 92 of file otimezone.cpp.

References QString::latin1(), m_name, qWarning(), Opie::to_Time_t(), utc(), and Opie::utcTime().

QDateTime OTimeZone::toDateTime time_t   ) 
 

converts the time_t to the time in the timezone

Definition at line 85 of file otimezone.cpp.

References m_name, and Opie::utcTime().

Referenced by OEvent::endDateTimeInZone(), ODateBookAccessBackend_XML::finalizeRecord(), OEvent::fromMap(), save(), OEvent::startDateTimeInZone(), and OEvent::toMap().

QDateTime OTimeZone::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.

Definition at line 76 of file otimezone.cpp.

References current().

QDateTime OTimeZone::toUTCDateTime const QDateTime dt  ) 
 

converts the QDateTime to UTC time

Definition at line 79 of file otimezone.cpp.

References utc().

OTimeZone OTimeZone::utc  )  [static]
 

Definition at line 108 of file otimezone.cpp.

References OTimeZone().

Referenced by ODateBookAccessBackend_XML::finalizeRecord(), ORecur::fromMap(), OEvent::fromMap(), OTodoAccessXML::load(), save(), toDateTime(), ORecur::toMap(), OEvent::toMap(), and toUTCDateTime().


Member Data Documentation

Private* OTimeZone::d [private]
 

Definition at line 66 of file otimezone.h.

ZoneName OTimeZone::m_name [private]
 

Definition at line 65 of file otimezone.h.

Referenced by fromDateTime(), isValid(), timeZone(), and toDateTime().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:43:43 2005 for OPIE by  doxygen 1.4.2