Unlike dates based on counting seconds, can represent any date.
IN:
- char* by assignment and setString
- long by assignment (internal representation is a long)
- set of 3 longs by setDate(Year, Month, Day)
- current date by setDateToday()
OUT:
- char*
- long
- set of 3 longs
NOTES:
Conversion of character strings to dates has a default order of DMY. You can change this to orderYMD, or orderMDY with a single line at the start of your program:
dbDate::sDefaultDateOrder=dbDate::orderMDY;
UTILITIES:
Static conversion utilities to let you use the same long representation. (Yes, I know this is a bit grotty but it was on request.) You can also apply the same parsing to string or stream to get the numbers back (subject to the default parsing order above).
ymd2Long
long2ymd
chars2ymd
chars2Long
istream2ymd
ymd2stream
today2ymd // returns the system date
today // stream manipulator, use as below (NOT with function call parens)
cout << dbDate::today << endl
----------
Numeric Types
----------
These all behave the same as their c++ native equivalents, with simple assignment to and from.
dbLong
dbUlong
dbShort
dbUshort
dbReal ( equivalent to standard 8-byte double)
----------
dbChar
----------
Fixed length string type.
----------
dbText
----------
Variable length string type. Based on dbBLOB. Can't be indexed other than by method (eg: keyword indexing).
----------
dbBLOB
----------
Base type for general Blobs that are "lazily loaded" as required.
----------
dbFixedBinary
----------
Data type for basing your own special types on. Internally maps to a character array so the current cross-platform implementation won't flip bytes.