Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages
comet::dateonly_t Struct Reference
[Miscelaneous utility classes.]
Wrapper for a date only class.
More...
#include <date.h>
Public Member Functions | |
| dateonly_t () | |
| constructor | |
| dateonly_t (const datetime_t &dt) | |
| Construct from a datetime_t. | |
| dateonly_t (const impl::auto_attach_t< long > &dateval) | |
| Attach from a long. | |
| long | get () const |
| Get the raw 'long' value. | |
| dateonly_t & | operator= (const impl::auto_attach_t< long > &dateval) |
| dateonly_t (dt_invalid_t) | |
| Initialise as invalid. | |
| dateonly_t (dt_null_t) | |
| Initialise as null. | |
| dateonly_t (dt_zero_t) | |
| Initialise as zero. | |
| dateonly_t (int year, int month, int day) | |
| Construct from year/month/day. | |
| void | split (int *year, int *month, int *day) const |
| Return year/month/day values. | |
| bool | set_date (int year, int month, int day) |
| operator datetime_t () const | |
| Convert to datetime. | |
| dateonly_t & | add_months (int inc_months) |
| dateonly_t & | add_years (int inc_years) |
| Add specified number of years. | |
| bool | invalid () const |
| return true if the date is marked 'invalid'. | |
| bool | null () const |
| Return true if the date is marked 'null'. | |
| bool | zero () const |
| return true if date is zero | |
| bool | good () const |
| Return true if the date is usable. | |
| bstr_t | format (datetime_t::format_flags flags=datetime_t::ff_default, LCID locale=LOCALE_USER_DEFAULT) const |
| dateonly_t & | parse (const bstr_t &val, datetime_t::format_flags flags=datetime_t::ff_default, LCID locale=LOCALE_USER_DEFAULT) |
| template<typename CHAR> std::basic_string< CHAR > | format (const std::basic_string< CHAR > &fmt) const |
| template<typename CHAR> std::basic_string< CHAR > | format (const CHAR *fmt) const |
Access date parts. | |
| int | year () const |
| Year. | |
| int | month () const |
| Month of year (1-based). | |
| int | day () const |
| Day of month (1-based). | |
| datetime_t::day_of_week | dow () const |
| The day of week. | |
| int | year_day () const |
| Day of the year (0 -based). | |
| int | days_in_month () const |
| Days in the month. | |
Comparison operators | |
| bool | operator== (const dateonly_t &date) const |
| bool | operator!= (const dateonly_t &date) const |
| bool | operator< (const dateonly_t &date) const |
| bool | operator> (const dateonly_t &date) const |
| bool | operator<= (const dateonly_t &date) const |
| bool | operator>= (const dateonly_t &date) const |
| bool | operator== (dt_invalid_t) const |
| bool | operator!= (dt_invalid_t) const |
| bool | operator== (dt_zero_t) const |
| bool | operator!= (dt_zero_t) const |
| bool | operator== (dt_null_t) const |
| bool | operator!= (dt_null_t) const |
Arithmetic operators | |
| dateonly_t | operator+ (long dateSpan) const |
| dateonly_t | operator- (long dateSpan) const |
| dateonly_t & | operator+= (long dateSpan) |
| dateonly_t & | operator-= (long dateSpan) |
| long | operator- (const dateonly_t &date) const |
| dateonly_t & | operator++ () |
| dateonly_t | operator++ (int) |
| dateonly_t & | operator-- () |
| dateonly_t | operator-- (int) |
Static Public Member Functions | |
| dateonly_t | get_null () |
| Get a 'NULL' datetime. | |
| dateonly_t | get_zero () |
| Get a 'zero' datetime. | |
| dateonly_t | today () |
| Return today. | |
| dateonly_t | today_utc () |
| Return today (UTC). | |
| int | days_in_month (int year, int month) |
Protected Member Functions | |
| dateonly_t (long l) | |
Friends | |
| std::basic_ostream< char > & | operator<< (std::basic_ostream< char > &os, const dateonly_t &val) |
| Stream operator. | |
| std::basic_ostream< wchar_t > & | operator<< (std::basic_ostream< wchar_t > &os, const dateonly_t &val) |
| Stream operator. | |
Detailed Description
Wrapper for a date only class.This is based on an integer version of DATE, except that it is an absolute offset from 1/1/0.
Member Function Documentation
|
|
Add specified number of months. If the day is not valid, force to the last day in the month. |
|
||||||||||
|
Format as basic_string.
|
|
||||||||||
|
Format as basic_string.
|
|
||||||||||||
|
Format as bstr.
|
|
||||||||||||||||
|
Parse bstring to a datetime_t.
|
|
||||||||||||||||
|
Set date part as year/month/day.
|
The documentation for this struct was generated from the following file: