VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
G::Date Class Reference

A date (dd/mm/yyyy) class. More...

#include <gdate.h>

Classes

class  LocalTime
 An overload discriminator class for Date constructors. More...
 

Public Types

enum  Weekday {
  sunday, monday, tuesday, wednesday,
  thursday, friday, saturday
}
 
enum  Month {
  january = 1, february, march, april,
  may, june, july, august,
  september, october, november, december
}
 
enum  Format { yyyy_mm_dd_slash, yyyy_mm_dd, mm_dd }
 

Public Member Functions

 Date ()
 Default constructor for the current date in the UTC timezone. More...
 
 Date (const LocalTime &)
 Constructor for the current date in the local timezone. More...
 
 Date (const G::DateTime::BrokenDownTime &tm)
 Constructor for the specified date.
 
 Date (G::EpochTime t)
 Constructor for the date in the UTC timezone as at the given epoch time. More...
 
 Date (G::EpochTime t, const LocalTime &)
 Constructor for the date in the local timezone as at the given epoch time. More...
 
 Date (int year, Month month, int day_of_month)
 Constructor for the specified date.
 
std::string string (Format format=yyyy_mm_dd_slash) const
 Returns a string representation of the date.
 
Weekday weekday () const
 Returns the day of the week.
 
std::string weekdayName (bool brief=false) const
 Returns an english string representation of the day of the week. More...
 
int monthday () const
 Returns the day of the month.
 
std::string dd () const
 Returns the day of the month as a two-digit decimal string. More...
 
Month month () const
 Returns the month.
 
std::string monthName (bool brief=false) const
 Returns the month as a string (in english).
 
std::string mm () const
 Returns the month as a two-digit decimal string.
 
int year () const
 Returns the year.
 
std::string yyyy () const
 Returns the year as a four-digit decimal string. More...
 
Dateoperator++ ()
 Increments the date by one day.
 
Dateoperator-- ()
 Decrements the date by one day.
 
bool operator== (const Date &rhs) const
 Comparison operator.
 
bool operator!= (const Date &rhs) const
 Comparison operator.
 

Static Public Member Functions

static int yearUpperLimit ()
 Returns the largest supported year value.
 
static int yearLowerLimit ()
 Returns the smallest supported year value.
 

Detailed Description

A date (dd/mm/yyyy) class.

See Also
G::Time, G::DateTime

Definition at line 39 of file gdate.h.

Constructor & Destructor Documentation

G::Date::Date ( )

Default constructor for the current date in the UTC timezone.

Definition at line 38 of file gdate.cpp.

G::Date::Date ( const LocalTime )
explicit

Constructor for the current date in the local timezone.

Definition at line 58 of file gdate.cpp.

G::Date::Date ( G::EpochTime  t)
explicit

Constructor for the date in the UTC timezone as at the given epoch time.

Definition at line 43 of file gdate.cpp.

G::Date::Date ( G::EpochTime  t,
const LocalTime  
)

Constructor for the date in the local timezone as at the given epoch time.

Definition at line 48 of file gdate.cpp.

Member Function Documentation

std::string G::Date::dd ( ) const

Returns the day of the month as a two-digit decimal string.

(Was monthdayString().)

Definition at line 116 of file gdate.cpp.

std::string G::Date::weekdayName ( bool  brief = false) const

Returns an english string representation of the day of the week.

(Was weekdayString().)

Definition at line 153 of file gdate.cpp.

std::string G::Date::yyyy ( ) const

Returns the year as a four-digit decimal string.

(Was yearString().)

Definition at line 192 of file gdate.cpp.


The documentation for this class was generated from the following files: