Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
DB Interface Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWDBDateTime

Module:  DB Interface Module   Group:  Data Type Classes


Does not inherit

Local Index

Members

Non-Members

Synopsis

#include <rw/db/datetime.h>

RWDBDateTime now; // construct current date and time
RWDBDateTime then((unsigned)1993,2,27,10,2,54)

Description


NOTE -- Class RWDBDateTime is deprecated. Please use RWDateTime. For more information, see Section 7.4.3 of the DB Interface Module User's Guide and the entry for RWDateTime in the Essential Tools Module Reference Guide.

RWDBDateTime represents a date and time stored as the number of milliseconds since January 1 1901 00:00:00:000 UTC. The member function isValid() can be used to determine whether an RWDBDateTime is a valid date and time. Note that RWDBDateTime is instantiated from the local system and not the database.

RWDBDateTime instances can be converted to and from RWDate, RWDateTime, and/or RWTime instances, and to and from the Standard C Library type struct tm defined in <time.h>.

Output formatting is done using an RWLocale object. The default locale formats data according to US conventions. See the Essential Tools Module Reference Guide for further discussion of RWLocale.

Related Classes

RWDate, RWTime, and RWDateTime can be used to create RWDBDateTime instances. Please see your Essential Tools Module documentation for information on RWDate, RWTime, and RWDateTime.

RWLocale is used to format the output of RWDBDateTime. Please see your Essential Tools Module documentation for information on RWLocale. Note that the character u can be used with RWLocale to denote milliseconds.

Public Enums

typedef enum Persistence { Default, Legacy };

NOTE -- For more information on persistence in RWDBDateTime, see Section 7.4.3.2 in the DB Interface Module User's Guide.

Static Public Member Functions

static void 
persistence(const RWDBDateTime::Persistence per);
static Persistence 
persistence(void);

Public Constructors

RWDBDateTime();
RWDBDateTime(const RWDBDateTime&);
explicit RWDBDateTime(const RWDateTime&);
RWDBDateTime(const struct tm* tm,    
             const RWZone& zone = RWZone::local());
RWDBDateTime(const RWTime& time, 
             const RWZone& zone = RWZone::local());
RWDBDateTime(const RWDate& date, unsigned hour = 0,
             unsigned minute = 0, unsigned second = 0,
             unsigned millisecond = 0,
             const RWZone& zone = RWZone::local());
RWDBDateTime(const RWDate& date, 
             const RWCString& str,
             const RWZone& zone = RWZone::local(),
             const RWLocale& = RWLocale::global());
RWDBDateTime(unsigned year, unsigned month, unsigned day,
             unsigned hour = 0, unsigned minute = 0,
             unsigned second = 0, unsigned millisecond = 0, 
             const RWZone& zone = RWZone::local());
RWDBDateTime(unsigned long jd, unsigned hour = 0,
             unsigned minute = 0, unsigned second = 0,
             unsigned millisecond = 0, const RWZone& zone =
             RWZone::local());

Type Conversion

operator RWDateTime();

Public Member Operator

RWDBDateTime& 
operator=(const RWDBDateTime& dt);

Public Member Functions

RWDBDateTime
addDays(long int num);
RWDBDateTime
addHours(rwint64 num);
RWDBDateTime
addMilliseconds(rwint64 num);
RWDBDateTime
addMinutes(rwint64 num);
RWDBDateTime
addMonths(long int num);
RWDBDateTime
addSeconds(rwint64 num);
RWDBDateTime
addYears(long int num);
RWCString
asString(char format = (char)'\0', 
         const RWZone& zone =  RWZone::local(),
         const RWLocale& locale = RWLocale::global()) const;
RWCString
asString(const char* format, 
         const RWZone& zone = RWZone::local(),
         const RWLocale& locale = RWLocale::global())const;
bool
between(const RWDBDateTime& dt1, 
        const RWDBDateTime& dt2) const;
RWspace
binaryStoreSize() const;
int 
compareTo(const RWDate* d) const;
int 
compareTo(const RWDBDateTime* dt) const;
int
compareTo(const RWTime* t) const;
unsigned 
day(const RWZone& zone = RWZone::local()) const;
unsigned 
dayOfMonth(const RWZone& zone = RWZone::local()) const;
void 
extract(struct tm* tmbuf, 
        const RWZone& zone = RWZone::local()) const;
unsigned 
firstDayOfMonth(const RWZone& zone = RWZone::local()) const;
unsigned 
firstDayOfMonth(unsigned month, 
                const RWZone& zone = RWZone::local()) const;
unsigned 
hash() const;
unsigned 
hour(const RWZone& zone = RWZone::local()) const;
unsigned
hourGMT() const;
bool
isDST(const RWZone& zone = RWZone::local()) const;
bool
isEqual(const RWDBDateTime& dt) const;
bool 
isValid() const;
bool 
leap(const RWZone& zone = RWZone::local()) const;
RWDBDateTime
max(const RWDBDateTime& dt) const;
rwint64
millisecond() const;
RWDBDateTime
min(const RWDBDateTime& dt) const;
unsigned
minute(const RWZone& timezone = RWZone::local()) const;
unsigned
minuteGMT() const;
unsigned 
month(const RWZone& zone = RWZone::local()) const;
RWCString
monthName(const RWLocale& locale = RWLocale::global(),
          const RWZone& zone = RWZone::local()) const;
void
now();
RWDBDateTime
previous(unsigned dayNum, const RWZone& zone = RWZone::local()) const;
RWDBDateTime
previous(const char* dayName, 
         const RWLocale& locale = RWLocale::global(),
         const RWZone& zone = RWZone::local()) const;
void
restoreFrom(RWFile& file);
void
restoreFrom(RWvistream& vis);
RWDate
rwdate() const;
RWTime 
rwtime() const;
void
saveOn(RWFile& file) const;
void
saveOn(RWvostream& vos) const;
unsigned
second() const;
unsigned rwint64
seconds() const;
unsigned 
weekDay(const RWZone& zone = RWZone::local()) const;
RWCString 
weekDayName(const RWLocale& locale = 
            RWLocale::global(), 
            const RWZone& zone = RWZone::local()) const;
unsigned
year(const RWZone& zone = RWZone::local()) const;

Related Global Operators

bool
operator<(const RWDBDateTime& dt1, 
          const RWDBDateTime& dt2);
bool 
operator<=(const RWDBDateTime& dt1,
           const RWDBDateTime& dt2);
bool
operator>(const RWDBDateTime& dt1,
          const RWDBDateTime& dt2);
bool 
operator>=(const RWDBDateTime& dt1,
           const RWDBDateTime& dt2);
bool 
operator==(const RWDBDateTime& dt1,
           const RWDBDateTime& dt2);
bool 
operator!=(const RWDBDateTime& dt1,
           const RWDBDateTime& dt2);


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.