referencetime [www ibpp org]


ïż

reference:time [www.ibpp.org]










[[reference:time]]

http://www.ibpp.org/












 


You are here: ibpp  reference  time


Table of Contents



IBPP:Time


Definition

Methods

Constructors

Operators

See
also
IBPP:Time

The IBPP::Time class represents a time value. It is not an interface class,
with automatic smart pointer management like for instance the Database class. It is a plain
classical C++ class. Use it to interact easily with TIME (SQL) columns in your databases.

Definition

See the file ibpp.h for an up-to-date definition.
A Time is internally made of a simple integer, representing the ten-thousands
of seconds elapsed since midnight (00h00m00s0000). Being made only of an integer
as its data part, the class Time is a light object which you can use without
fear of bulky data structures.
Methods

void Clear()

Resets the time to midnight (0).
void Now()

Sets the time to â€Åšnow’ (local time).
void
SetTime(int hour, int minute, int second, int tenthousandths = 0)

Sets the time according to the individual components. The ten-thousandths of
second are optional and default to 0 for ease of use.
SetTime(int tm)

Sets the time based on an integer value, as the one internally stored in the
time object itself. See the int GetTime() method too.
void GetTime(int& hour,
int& minute, int& second)

Gets a time in its basic components hours, minutes, seconds.
void
GetTime(int& hour, int& minute, int& second,
int&tenthousandths)

Gets a time in its basic components hours, minutes, seconds and
ten-thousandths of a second.
int GetTime()

Returns the internal integer representing the time value. Usefull for some
time arithmetic.
int Hours(), int
Minutes(), int Seconds(), int SubSeconds()

Return the hour, minute, second, subsecond value of the Time. Subseconds are
actually ten-thousandths of seconds.
Constructors

Time()

The default constructructor builds an empty time (midnight), same as if
Clear() was called on an existing time.
Time(int tm)

Similarly to the SetTime(int) method, this form of the constructor builds a
time out of the internal representation of another one.
Time(int hour, int
minute, int second, int tenthousandths = 0)

Similarly to the SetTime(int, int, int, int = 0) method, this form of the
constructor builds a time our of its basic components (hour, minute, second and
optionally ten-thousandths of a second).
Time(const Time&)

Ordinary copy constructor. To make the Time a good citizen of your code.

Operators

Time&
operator=(const Time&)

To assign a time from another one.
Time& operator=(const
Timestamp&)

To assign a time from the time portion of a Timestamp object.
bool
operator==(const Time&)

To compare two Times for equality.
bool
operator<(const Time&)

To compare if one Time is strictly â€Åšlower’ (the time is before) the other.

See also

These classes are closely related to this one :


Date

Timestamp




reference\time.txt · Last modified: 2006/03/30 18:34 by olivier











 






Wyszukiwarka

Podobne podstrony:
referenceeventinterface [www ibpp org]
referencetimestamp [www ibpp org]
reference [www ibpp org]
referenceevents [www ibpp org]
referencesamples [www ibpp org]
referenceexceptions [www ibpp org]
referencearray [www ibpp org]
referencecompilers [www ibpp org]
referenceblob [www ibpp org]
referenceclientlibsearchpaths [www ibpp org]
referencedate [www ibpp org]
referenceguidelines [www ibpp org]
referenceconversions [www ibpp org]
referencedatabase [www ibpp org]
referenceuser [www ibpp org]
referencetransaction [www ibpp org]
referencestatement [www ibpp org]
referenceoverview [www ibpp org]
referenceservice [www ibpp org]

więcej podobnych podstron