• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

Public Member Functions | Static Public Member Functions | Static Public Attributes
KTimezone Class Reference

#include <ktimezones.h>

List of all members.

Public Member Functions

 KTimezone (TDESharedPtr< KTimezoneSource > db, const TQString &name, const TQString &countryCode=TQString(), float latitude=UNKNOWN, float longitude=UNKNOWN, const TQString &comment=TQString())
TQString name () const
TQString countryCode () const
float latitude () const
float longitude () const
int offset (Qt::TimeSpec basisSpec=Qt::UTC) const
int offset (const TQDateTime &dateTime) const
TQDateTime convert (const KTimezone *newZone, const TQDateTime &dateTime) const
TQString comment () const
bool parse (KTimezoneDetails &dataReceiver) const

Static Public Member Functions

static bool isValidLatitude (float latitude)
static bool isValidLongitude (float longitude)

Static Public Attributes

static const float UNKNOWN = 1000.0

Detailed Description

The KTimezone class contains core functions related to a timezone.

Instances are created in the context of a KTimezoneSource which provides extended functionality via KTimezoneDetails.

See also:
KTimezoneSource
KTimezoneDetails
Since:
3.5
Author:
S.R.Haque <srhaque@iee.org>.

Definition at line 85 of file ktimezones.h.


Constructor & Destructor Documentation

KTimezone::KTimezone ( TDESharedPtr< KTimezoneSource >  db,
const TQString &  name,
const TQString &  countryCode = TQString(),
float  latitude = UNKNOWN,
float  longitude = UNKNOWN,
const TQString &  comment = TQString() 
)

Create a timezone.

Parameters:
dbdatabase of timezones.
namein system-dependent format.
countryCodeISO 3166 2-character country code, empty if unknown.
latitudein degrees, UNKNOWN if not known.
longitudein degrees, UNKNOWN if not known.
commentdescription of the timezone, if any.

Definition at line 205 of file ktimezones.cpp.


Member Function Documentation

TQString KTimezone::comment ( ) const

Returns any comment for the timezone.

Returns:
comment, may be empty.

Definition at line 230 of file ktimezones.cpp.

TQDateTime KTimezone::convert ( const KTimezone *  newZone,
const TQDateTime &  dateTime 
) const

Convert a date/time (which is interpreted as being localtime in this timezone) into localtime in the given timezone.

Returns:
converted date/time.

Definition at line 235 of file ktimezones.cpp.

TQString KTimezone::countryCode ( ) const

Returns the two-letter country code of the timezone.

Returns:
ISO 3166 2-character country code, empty if unknown.

Definition at line 263 of file ktimezones.cpp.

bool KTimezone::isValidLatitude ( float  latitude) [static]

A test for a valid latitude.

The valid range is +90.0 (North Pole) to -90.0 (South Pole).

Definition at line 195 of file ktimezones.cpp.

bool KTimezone::isValidLongitude ( float  longitude) [static]

A test for a valid longitude.

The valid range is +180.0 (east of Greenwich) to -180.0 (west of Greenwich).

Definition at line 200 of file ktimezones.cpp.

float KTimezone::latitude ( ) const

Returns the latitude of the timezone.

Returns:
latitude in degrees, UNKNOWN if not known.

Definition at line 268 of file ktimezones.cpp.

float KTimezone::longitude ( ) const

Returns the latitude of the timezone.

Returns:
latitude in degrees, UNKNOWN if not known.

Definition at line 273 of file ktimezones.cpp.

TQString KTimezone::name ( ) const

Returns the name of the timezone.

Returns:
name in system-dependent format.

Definition at line 278 of file ktimezones.cpp.

int KTimezone::offset ( Qt::TimeSpec  basisSpec = Qt::UTC) const

Returns the current offset of this timezone to UTC or the local timezone in seconds.

Take care if you cache the results of this routine; that would break if the result were stored across a daylight savings change.

Returns:
offset in seconds.

Definition at line 283 of file ktimezones.cpp.

int KTimezone::offset ( const TQDateTime &  dateTime) const

Returns the offset of the given timezone to UTC at the given date/time (which is interpreted as being UTC).

Returns:
offset in seconds.

Definition at line 309 of file ktimezones.cpp.

bool KTimezone::parse ( KTimezoneDetails &  dataReceiver) const

Extract timezone detail information.

Returns:
true if the parse encountered no errors.

Definition at line 320 of file ktimezones.cpp.


Member Data Documentation

const float KTimezone::UNKNOWN = 1000.0 [static]

A representation for unknown locations; this is a float that does not represent a real latitude or longitude.

Definition at line 92 of file ktimezones.h.


The documentation for this class was generated from the following files:
  • ktimezones.h
  • ktimezones.cpp

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.