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.

An InvokeDateTime object contains a calendar date, a clock time, and an optional time zone. If the time zone is not specified, the InvokeDateTime represents a roaming time that is always relative to the current time zone. If the time zone is specified, the InvokeDateTime represents an anchored time in a specific time zone (for example, 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

Represents an unknown type.

Roaming 1

Represents a local time.

For example, the InvokeDateTime object might represent 7am regardless of the time zone.

Since:

BlackBerry 10.3.0

Anchored 2

Represents a global time.

For example, the InvokeDateTime object might represent 7am in New York.

Since:

BlackBerry 10.3.0

Public Functions

InvokeDateTime ()

Creates an InvokeDateTime object.

The specific time parameters need to be set by calling set().

Since:

BlackBerry 10.3.0

InvokeDateTime (

Creates an InvokeDateTime object with the parameters provided.

Parameters
date

The date.

time

The time. Note: Seconds and milliseconds of time are ignored here.

timeZone

The time zone ID. 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(), which is 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. 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 ()

Returns the date.

Return:

The 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 that is unrecognized is still considered valid, but may cause functions taking an 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 parameters for this InvokeDateTime object.

Parameters
date

The date.

time

The time. Note: Seconds and milliseconds of time are ignored here.

timeZone

The time zone ID. 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. 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 ()

Returns the time.

Return:

The time that was previously set.

Since:

BlackBerry 10.3.0

QString timeZone ()

Returns the time zone.

Return:

The time zone that was previously set or an empty string.

Since:

BlackBerry 10.3.0

InvokeDateTime::Type type ()

Returns the type.

Return:

The type.

Since:

BlackBerry 10.3.0

Last modified: 2015-01-22



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

comments powered by Disqus