referencetimestamp [www ibpp org]


ïż

reference:timestamp [www.ibpp.org]










[[reference:timestamp]]

http://www.ibpp.org/












 


You are here: ibpp  reference  timestamp


Table of Contents



IBPP::Timestamp


Definition

Methods

Constructors

Operators

See
also
IBPP::Timestamp

The IBPP::Timestamp class represents a SQL timestamp 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 TIMESTAMP (SQL) columns in your databases.

Definition

See the file ibpp.h for an up-to-date definition.
A Timestamp is a pure inline class, inheriting simply from both the Date and Time classes
and overriding some of the methods. This implies that a Timestamp is made of
just two integers for its data part. The class Timestamp is a light object which
you can use without fear of bulky data structures.
Also, this documentation only describes methods which are overriden from
their base Date and Time or
added. All the other methods of their base classes are available. For instance,
one can call the Date AddDays() method on a Timestamp value.
Methods

void Clear()

Resets the date to -1 (invalid date) and the time to midnight (0),
effectively clearing the Timestamp to its default value after construction.

void Today()

Similar to its Date counterpart, sets the date to today, but clears the time
part to 0.
void Now()

Similar to its Time counterpart, sets both the date and the time to â€Åšnow’
(local time).
Constructors

Timestamp()

The default constructructor builds an empty timestamp (no date and midnight),
same as if Clear() was called on an existing timestamp.
Time(int year, int month, int day)

Creates a Timestamp with that date and a time of 0.
Time(int
year, int month, int day, int hour, int minute, int second, int tenthousands =
0)

Creates a Timestamp with that date and time, tenthousands being optional and
defaulting to 0.
Timestamp(const Timestamp&)

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

Timestamp(const
Date&)

Creates a Timestamp by copying a Date. The time portion is set to 0.

Timestamp(const
Time&)

Creates a Timestamp by copying a Time. The date is set to invalid (-1).

Operators

Timestamp& operator=(const
Timestamp&)

To assign a timestamp from another one.
Timestamp& operator=(const
Date&)

To assign a timestamp from a date, the time portion is set to 0.
Timestamp& operator=(const
Time&)

To assign a timestamp from a time, the date portion is set to invalid (-1).

bool
operator==(const Timestamp&)

To compare two Timestamps for equality (date and time exactly equal).

bool operator<(const
Timestamp&)

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

See also

These classes are closely related to this one :


Date

Time




reference\timestamp.txt · Last modified: 2006/03/30 09:07 by
olivier










 






Wyszukiwarka

Podobne podstrony:
referenceeventinterface [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]
referencetime [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