InvokeDateTime

Since: BlackBerry 10.3.0

#include <bb/system/InvokeDateTime>

To link against this class, add the following line to your .pro file: LIBS += -lbbsystem

Encapsulates a specific date and time.

A InvokeDateTime object contains a calendar date, a clock time and an optional time zone. If no time zone is assigned, then the InvokeDateTime represents a Roaming time, always relative to the current time zone. Otherwise (if the time zone is non-empty) the InvokeDateTime represents an Anchored time - that time in that time zone, ie 8:00am in Los Angeles.


Overview

Public Types Index

enum Type

Unknown 0, Roaming 1, Anchored 2

Public Functions Index

InvokeDateTime ()
InvokeDateTime (const QDate &date, const QTime &time, const QString &timeZone=QString())
InvokeDateTime (const InvokeDateTime &other)
~InvokeDateTime ()
QDatedate () const
boolisValid () const
InvokeDateTime &operator= (const InvokeDateTime &other)
voidset (const QDate &date, const QTime &time, const QString &timeZone=QString())
voidsetDate (const QDate &date)
voidsetTime (const QTime &time)
voidsetTimeZone (const QString &timeZone)
QTimetime () const
QStringtimeZone () const
InvokeDateTime::Typetype () const

Public Types

Type

The kinds of InvokeDateTime objects that can be created.

Since:

BlackBerry 10.3.0

Unknown 0

Unknown type.

Roaming 1

Represents a local time.

eg. 7am irrespective of the time zone

Since:

BlackBerry 10.3.0

Anchored 2

Represents a global time.

eg. 7am in New York

Since:

BlackBerry 10.3.0

Public Functions

InvokeDateTime ()

Creates a new InvokeDateTime object.

The specific time params need to be set by calling the method set

Since:

BlackBerry 10.3.0

InvokeDateTime (

Creates a new InvokeDateTime object with the params provided.

Parameters
date

The date.

time

The time. Note: seconds and milliseconds of date are ignored here.

timeZone

The timeZone ID to set. If this parameter is not empty then the InvokeDateTime is of type #InvokeDateTime::Anchored. If this parameter is empty then the InvokeDateTime is of type #InvokeDateTime::Roaming. The time zone ID can be a programmatic ID such as "America/Los_Angeles" which is defined in the standard Olson/IANA timezone database used by UNIX systems. The programmatic ID has the format continent/city or ocean/city. The time zone ID can also be a custom ID such as "GMT-8:00". The custom ID has the syntax "GMT[+|-]hh[[:]mm]". A list of supported time zone IDs can be obtained by calling #icu::TimeZone::createEnumeration() declared in header file <unicode/timezone.h> The wikipedia link http://en.wikipedia.org/wiki/List_of_tz_database_time_zones has a list of time zones in the programmatic ID format. Please use the latter with caution, as some of these may or may not be supported on your platform.

Since:

BlackBerry 10.3.0

InvokeDateTime (

Creates a copy of an existing InvokeDateTime object.

Parameters
other

The source InvokeDateTime object to copy.

Since:

BlackBerry 10.3.0

~InvokeDateTime ()

Destructor.

Since:

BlackBerry 10.3.0

QDate date ()

Return the date.

The method returns the date that was previously set.

Return:

date that was previously set

Since:

BlackBerry 10.3.0

bool isValid ()

Returns true if this InvokeDateTime object is valid.

The method returns true if both the date and the time of this InvokeDateTime object are valid. This method does not check to see if an assigned time zone is recognized. An assigned time zone which is unrecognized is still considered valid, but may cause functions taking a InvokeDateTime to fail.

Return:

true if valid, false otherwise

Since:

BlackBerry 10.3.0

InvokeDateTime & operator= (

Copies the data of an existing InvokeDateTime object to this object.

Parameters
other

The source InvokeDateTime object to copy.

Return:

The InvokeDateTime instance.

Since:

BlackBerry 10.3.0

void set (

Sets the params for this InvokeDateTime object.

Parameters
date

The date.

time

The time. Note: seconds and milliseconds of date are ignored here.

timeZone

The timeZone ID to set. If this parameter is not empty then the InvokeDateTime is of type #InvokeDateTime::Anchored. If this parameter is empty then the InvokeDateTime is of type #InvokeDateTime::Roaming. The time zone ID can be a programmatic ID such as "America/Los_Angeles" which is defined in the standard Olson/IANA timezone database used by UNIX systems. The programmatic ID has the format continent/city or ocean/city. The time zone ID can also be a custom ID such as "GMT-8:00". The custom ID has the syntax "GMT[+|-]hh[[:]mm]". A list of supported time zone IDs can be obtained by calling #icu::TimeZone::createEnumeration() declared in header file <unicode/timezone.h> The wikipedia link http://en.wikipedia.org/wiki/List_of_tz_database_time_zones has a list of time zones in the programmatic ID format. Please use the latter with caution, as some of these may or may not be supported on your platform.

Since:

BlackBerry 10.3.0

void setDate (

Sets the date.

Parameters
date

The date.

Since:

BlackBerry 10.3.0

void setTime (

Sets the time.

Parameters
time

The time.

Since:

BlackBerry 10.3.0

void setTimeZone (

Sets the time zone.

Setting the time zone to an empty string sets the type of the InvokeDateTime to Roaming. A non-empty string makes it Anchored.

Parameters
timeZone

The time zone.

Since:

BlackBerry 10.3.0

QTime time ()

Return the time.

The method returns the time that was previously set.

Return:

time that was previously set

Since:

BlackBerry 10.3.0

QString timeZone ()

Return the timeZone.

The method returns the timeZone that was previously set.

Return:

timeZone that was previously set or an empty string

Since:

BlackBerry 10.3.0

InvokeDateTime::Type type ()

Return the type.

The method returns the type.

Return:

type.

Since:

BlackBerry 10.3.0

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus