libopie PIM API Documentation

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:

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)
 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

typedef QString OTimeZone::ZoneName
 

Definition at line 15 of file otimezone.h.

Referenced by OTimeZone().


Constructor & Destructor Documentation

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

Definition at line 62 of file otimezone.cpp.

References ZoneName.

Referenced by utc().

OTimeZone::~OTimeZone  )  [virtual]
 

Definition at line 65 of file otimezone.cpp.


Member Function Documentation

bool OTimeZone::isValid  )  const
 

Definition at line 68 of file otimezone.cpp.

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(), and toDateTime().

QDateTime OTimeZone::toUTCDateTime const QDateTime dt  ) 
 

converts the QDateTime to UTC time

Definition at line 79 of file otimezone.cpp.

References toDateTime(), and utc().

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 utcTime().

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

QDateTime OTimeZone::toDateTime time_t   ) 
 

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().

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, to_Time_t(), utc(), and utcTime().

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 to_Time_t().

time_t OTimeZone::fromUTCDateTime const QDateTime  ) 
 

converts the datetime with timezone UTC

Definition at line 100 of file otimezone.cpp.

References to_Time_t().

OTimeZone OTimeZone::current  )  [static]
 

Definition at line 103 of file otimezone.cpp.

Referenced by OEvent::endDateTimeInZone(), save(), OEvent::startDateTimeInZone(), and toLocalDateTime().

OTimeZone OTimeZone::utc  )  [static]
 

Definition at line 108 of file otimezone.cpp.

References OTimeZone().

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

QString OTimeZone::timeZone  )  const
 

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:
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:26:27 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001