Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]


Date And Time Handling Overview

[Top]


Purpose

Manipulates date and time values.

[Top]


Architectural relationships

The system maintains two clocks:

The non-secure clock is implemented in terms of an offset from the secure clock.

Both the secure time and the non-secure time can be set using the System Static Functions API, and specifically:

Secure time

Non-secure time

System locale settings, which affect date and time formatting, are set through TLocale in the Locale Settings API.

[Top]


Description

The API has three key concepts: point in time, time utilities, and time interval.


Point in time

The point in time is a 64-bit integer that represents time as the number of microseconds since midnight on 1st January 0 AD, using a nominal Gregorian calendar. It can be set to the current system time, can have arithmetic and comparison operations performed on it, and can be converted into a string formatted according to the locale and other options.

The main point in time interface is provided by TTime. A support class TDateTime is provided that allows time values to be get and set in an easy-to-use format, such as year, month, day, rather than as an integer.

The time value in a TTime object can be set using either the secure time or the non-secure time.


Time utilities

The time utilities provides miscellaneous time functions, for such things as checking for leap years.

The time utilities interface is provided by Time.


Time interval

The time interval represents a period between two points in time. Time intervals can be added or subtracted, either to or from each other or to or from points in time.

The time interval interface is provided by a base class TTimeIntervalBase and by a family of derived classes for second, minute, hour, etc. intervals. A class outside this hierarchy, TTimeIntervalMicroSeconds, is provided for efficiency reasons (it alone stores its value as a 64-bit number).

[Top]


See also

Locale Settings Overview

System Static Functions Overview