Nana C++ Library. Reference for users.
What we need to use nana
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
nana::date Class Reference

A date operation class. More...

Classes

struct  value
 

Public Member Functions

 date ()
 the initialized date is today. More...
 
 date (const std::tm &)
 
 date (int year, int month, int day)
 
date operator- (int off) const
 
date operator+ (int off) const
 
bool operator== (const date &) const
 
bool operator!= (const date &) const
 
bool operator< (const date &) const
 
bool operator> (const date &) const
 
bool operator<= (const date &) const
 
bool operator>= (const date &) const
 
int day_of_week () const
 
const valueread () const
 
void set (const std::tm &)
 

Static Public Member Functions

static int day_of_week (int year, int month, int day)
 
static unsigned year_days (const unsigned year)
 the number of days in the specified year. More...
 
static unsigned month_days (const unsigned year, const unsigned month)
 the number of days in the specified month. More...
 
static unsigned day_in_year (unsigned y, unsigned m, unsigned d)
 Returns the index of the specified day in this year, at range[1, 365] or [1, 366]. More...
 

Detailed Description

A date operation class.

See Also
nana::date_chooser

Constructor & Destructor Documentation

nana::date::date ( )

the initialized date is today.

nana::date::date ( const std::tm t)
explicit
nana::date::date ( int  year,
int  month,
int  day 
)

Member Function Documentation

unsigned nana::date::day_in_year ( unsigned  y,
unsigned  m,
unsigned  d 
)
static

Returns the index of the specified day in this year, at range[1, 365] or [1, 366].

int nana::date::day_of_week ( ) const
int nana::date::day_of_week ( int  year,
int  month,
int  day 
)
static
unsigned nana::date::month_days ( const unsigned  year,
const unsigned  month 
)
static

the number of days in the specified month.

bool nana::date::operator!= ( const date r) const
date nana::date::operator+ ( int  off) const
date nana::date::operator- ( int  off) const
Initial value:
{
if(1601 <= year && year < 30827 && 0 < month && month < 13 && day > 0)
{
if(day <= static_cast<int>(date::month_days(year, month)))
return;
}
static unsigned month_days(const unsigned year, const unsigned month)
the number of days in the specified month.
Definition: datetime.cpp:242
void set(const std::tm &)
Definition: datetime.cpp:54
T localtime(T...args)
bool nana::date::operator< ( const date r) const
bool nana::date::operator<= ( const date r) const
bool nana::date::operator== ( const date r) const
bool nana::date::operator> ( const date r) const
bool nana::date::operator>= ( const date r) const
const date::value & nana::date::read ( ) const
void nana::date::set ( const std::tm t)
unsigned nana::date::year_days ( const unsigned  year)
static

the number of days in the specified year.