Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | List of all members
Proud::CPnTime Class Reference

Public Types

enum  DateTimeStatus { error = -1, valid = 0, invalid = 1, null = 2 }
 

Public Member Functions

 CPnTime () throw ()
 
 CPnTime (const VARIANT &varSrc) throw ()
 
 CPnTime (__time64_t timeSrc) throw ()
 
 CPnTime (const SYSTEMTIME &systimeSrc) throw ()
 
 CPnTime (const FILETIME &filetimeSrc) throw ()
 
 CPnTime (int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nMillisec) throw ()
 
 CPnTime (uint16_t wDosDate, uint16_t wDosTime) throw ()
 
 CPnTime (const DBTIMESTAMP &dbts) throw ()
 
bool GetAsDBTIMESTAMP (DBTIMESTAMP &dbts) const throw ()
 
void SetStatus (DateTimeStatus status) throw ()
 
DateTimeStatus GetStatus () const throw ()
 
bool GetAsSystemTime (SYSTEMTIME &sysTime) const throw ()
 
bool GetAsUDATE (UDATE &udate) const throw ()
 
int GetYear () const throw ()
 
int GetMonth () const throw ()
 
int GetDay () const throw ()
 
int GetHour () const throw ()
 
int GetMinute () const throw ()
 
int GetSecond () const throw ()
 
int GetMillisecond () const throw ()
 
int GetDayOfWeek () const throw ()
 
int GetDayOfYear () const throw ()
 
CPnTimeoperator= (const VARIANT &varSrc) throw ()
 
CPnTimeoperator= (const __time64_t &timeSrc) throw ()
 
CPnTimeoperator= (const SYSTEMTIME &systimeSrc) throw ()
 
CPnTimeoperator= (const FILETIME &filetimeSrc) throw ()
 
CPnTimeoperator= (const UDATE &udate) throw ()
 
bool operator== (const CPnTime &date) const throw ()
 
bool operator!= (const CPnTime &date) const throw ()
 
bool operator< (const CPnTime &date) const throw ()
 
bool operator> (const CPnTime &date) const throw ()
 
bool operator<= (const CPnTime &date) const throw ()
 
bool operator>= (const CPnTime &date) const throw ()
 
CPnTime operator+ (CPnTimeSpan dateSpan) const throw ()
 
CPnTime operator- (CPnTimeSpan dateSpan) const throw ()
 
CPnTimeoperator+= (CPnTimeSpan dateSpan) throw ()
 
CPnTimeoperator-= (CPnTimeSpan dateSpan) throw ()
 
CPnTimeSpan operator- (const CPnTime &date) const throw ()
 
int SetDateTime (int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nMillisec) throw ()
 
int SetDate (int nYear, int nMonth, int nDay) throw ()
 
int SetTime (int nHour, int nMin, int nSec, int nMillisec) throw ()
 
bool ParseDateTime (const TCHAR *lpszDate, uint32_t dwFlags=0, LCID lcid=LANG_USER_DEFAULT) throw ()
 
String Format (uint32_t dwFlags=0, LCID lcid=LANG_USER_DEFAULT) const
 
String Format (const TCHAR *lpszFormat) const
 
String Format (uint32_t nFormatID) const
 

Static Public Member Functions

static CPnTime WINAPI GetCurrentTime () throw ()
 
static CPnTime FromDATE (DATE dtSrc)
 

Public Attributes

DATE m_dt
 
DateTimeStatus m_status
 

Protected Member Functions

void CheckRange ()
 
BOOL ConvertSystemTimeToVariantTime (const SYSTEMTIME &systimeSrc)
 

Static Protected Member Functions

static double WINAPI DoubleFromDate (DATE date) throw ()
 
static DATE WINAPI DateFromDouble (double f) throw ()
 

Detailed Description

Date and time data type

Member Enumeration Documentation

Valid state of date and time

Enumerator
error 

Error

valid 

Valid

invalid 

Invalid date (out of range, etc.)

null 

Literally has no value

Constructor & Destructor Documentation

Proud::CPnTime::CPnTime ( ) throw ()

Constructor

Proud::CPnTime::CPnTime ( const VARIANT &  varSrc) throw ()

Constructor

Proud::CPnTime::CPnTime ( __time64_t  timeSrc) throw ()

Constructor

Proud::CPnTime::CPnTime ( const SYSTEMTIME &  systimeSrc) throw ()

Constructor

Proud::CPnTime::CPnTime ( const FILETIME &  filetimeSrc) throw ()

Constructor

Proud::CPnTime::CPnTime ( int  nYear,
int  nMonth,
int  nDay,
int  nHour,
int  nMin,
int  nSec,
int  nMillisec 
) throw ()

Constructor

Proud::CPnTime::CPnTime ( uint16_t  wDosDate,
uint16_t  wDosTime 
) throw ()

Constructor

Member Function Documentation

String Proud::CPnTime::Format ( uint32_t  dwFlags = 0,
LCID  lcid = LANG_USER_DEFAULT 
) const

Converts date and time into text string

String Proud::CPnTime::Format ( const TCHAR *  lpszFormat) const

Converts date and time into text string

String Proud::CPnTime::Format ( uint32_t  nFormatID) const

Converts date and time into text string

static CPnTime Proud::CPnTime::FromDATE ( DATE  dtSrc)
static

Creates this object from date type

int Proud::CPnTime::GetDay ( ) const throw ()

Gets day value

int Proud::CPnTime::GetDayOfWeek ( ) const throw ()

Gets day of the week value (1: Sunday, 2: Monday...)

int Proud::CPnTime::GetDayOfYear ( ) const throw ()

Gets which day in a year (1: 1st January)

int Proud::CPnTime::GetHour ( ) const throw ()

Gets hour value

int Proud::CPnTime::GetMillisecond ( ) const throw ()

Gets millisecond value

int Proud::CPnTime::GetMinute ( ) const throw ()

Gets minute value

int Proud::CPnTime::GetMonth ( ) const throw ()

Gets month value

int Proud::CPnTime::GetSecond ( ) const throw ()

Gets second value

int Proud::CPnTime::GetYear ( ) const throw ()

Gets year

bool Proud::CPnTime::operator!= ( const CPnTime date) const throw ()

Comparison operator

CPnTime Proud::CPnTime::operator+ ( CPnTimeSpan  dateSpan) const throw ()

Four-fundamental operator for date

CPnTime& Proud::CPnTime::operator+= ( CPnTimeSpan  dateSpan) throw ()

Four-fundamental operator for date

CPnTime Proud::CPnTime::operator- ( CPnTimeSpan  dateSpan) const throw ()

Four-fundamental operator for date

CPnTimeSpan Proud::CPnTime::operator- ( const CPnTime date) const throw ()

Four-fundamental operator for date

CPnTime& Proud::CPnTime::operator-= ( CPnTimeSpan  dateSpan) throw ()

Four-fundamental operator for date

bool Proud::CPnTime::operator< ( const CPnTime date) const throw ()

Comparison operator

bool Proud::CPnTime::operator<= ( const CPnTime date) const throw ()

Comparison operator

CPnTime& Proud::CPnTime::operator= ( const VARIANT &  varSrc) throw ()

Copy assignment operator

CPnTime& Proud::CPnTime::operator= ( const __time64_t &  timeSrc) throw ()

Copy assignment operator

CPnTime& Proud::CPnTime::operator= ( const SYSTEMTIME &  systimeSrc) throw ()

Copy assignment operator

CPnTime& Proud::CPnTime::operator= ( const FILETIME &  filetimeSrc) throw ()

Copy assignment operator

CPnTime& Proud::CPnTime::operator= ( const UDATE &  udate) throw ()

Copy assignment operator

bool Proud::CPnTime::operator== ( const CPnTime date) const throw ()

Comparison operator

bool Proud::CPnTime::operator> ( const CPnTime date) const throw ()

Comparison operator

bool Proud::CPnTime::operator>= ( const CPnTime date) const throw ()

Comparison operator

bool Proud::CPnTime::ParseDateTime ( const TCHAR *  lpszDate,
uint32_t  dwFlags = 0,
LCID  lcid = LANG_USER_DEFAULT 
) throw ()

Gets date and time from text string

int Proud::CPnTime::SetDate ( int  nYear,
int  nMonth,
int  nDay 
) throw ()

Setting date and time

int Proud::CPnTime::SetDateTime ( int  nYear,
int  nMonth,
int  nDay,
int  nHour,
int  nMin,
int  nSec,
int  nMillisec 
) throw ()

Setting date and time

int Proud::CPnTime::SetTime ( int  nHour,
int  nMin,
int  nSec,
int  nMillisec 
) throw ()

Setting date and time