DateTime Module

Classes

struct  common::DATESPAN
 Reprezentuje odcinek czasu. More...
struct  common::TIMESPAN
 Reprezentuje odcinek czasu. More...
struct  common::TMSTRUCT
 Reprezentuje moment czasu. More...
struct  common::DATETIME
 Reprezentuje moment czasu. More...
struct  common::GameTime
 Reprezentuje bądź to bezwzględny czas systemowy, bądź też odcinek (róznicę) czasu, jeśli odjęte dwa GameTime. More...

Enumerations

enum  common::WEEKDAY {
  common::SUN, common::MON, common::TUE, common::WED,
  common::THU, common::FRI, common::SAT, common::INV_WEEKDAY
}
 

Dzień tygodnia.

More...
enum  common::MONTH {
  common::JAN, common::FEB, common::MAR, common::APR,
  common::MAY, common::JUN, common::JUL, common::AUG,
  common::SEP, common::OCT, common::NOV, common::DEC,
  common::INV_MONTH
}
 

Miesiąc roku.

More...
enum  common::NAME_FORM {
  common::NAME_SHORT = 0x00, common::NAME_LONG = 0x01, common::NAME_LOWERCASE = 0x00, common::NAME_FIRST_UPPERCASE = 0x10,
  common::NAME_UPPERCASE = 0x20, common::NAME_SHORT_LOWERCASE = 0x00, common::NAME_SHORT_FIRST_UPPERCASE = 0x10, common::NAME_SHORT_UPPERCASE = 0x20,
  common::NAME_LONG_LOWERCASE = 0x01, common::NAME_LONG_FIRST_UPPERCASE = 0x11, common::NAME_LONG_UPPERCASE = 0x21
}
 

Flagi bitowe - należy połączyć razem flagę SHORT/LONG z flagą LOWERCASE/FIRST_UPPERCASE/UPPERCASE lub użyć jednej z już połączonych.

More...

Functions

DATESPAN common::operator+ (const DATESPAN &ds1, const DATESPAN &ds2)
DATESPAN common::operator- (const DATESPAN &ds1, const DATESPAN &ds2)
DATESPAN common::operator* (const DATESPAN &ds, int n)
DATESPAN common::operator* (int n, const DATESPAN &ds)
TIMESPAN common::operator* (const TIMESPAN &t, int n)
TIMESPAN common::operator* (int n, const TIMESPAN &t)
TIMESPAN common::operator+ (const TIMESPAN &t1, const TIMESPAN &t2)
TIMESPAN common::operator- (const TIMESPAN &t1, const TIMESPAN &t2)
TMSTRUCT common::operator+ (const TMSTRUCT &tm, const DATESPAN &ds)
TMSTRUCT common::operator- (const TMSTRUCT &tm, const DATESPAN &ds)
TIMESPAN common::operator- (const DATETIME &dt1, const DATETIME &dt2)
DATETIME common::operator+ (const DATETIME &dt, const TIMESPAN &ts)
DATETIME common::operator- (const DATETIME &dt, const TIMESPAN &ts)
bool common::IsLeapYear (int Year)
 Zwraca true, jeśli podany rok jest przestępny.
uint common::GetNumOfDaysInYear (int Year)
 Zwraca liczbę dni w podanym roku (365 lub 366).
uint common::GetNumOfDaysInMonth (int Year, uint Month)
 Zwraca liczbę dni w podanym miesiącu podanego roku.
int common::GetCentury (int Year)
 Zwraca wiek podanego roku.
time_t common::GetTimeNow ()
 Zwraca bieżącą datę i czas jako time_t.
void common::GetTmNow (struct tm *Out)
 Zwraca bieżącą datę i czas jako struct tm.
DATETIME common::Now ()
 Zwraca bieżącą datę i czas, dokładność co do sekund.
DATETIME common::UNow ()
 Zwraca bieżącą datę i czas, dokładność co do milisekund.
const tchar * common::GetWeekDayName (WEEKDAY WeekDay, NAME_FORM Form)
 Zwraca nazwę dnia tygodnia w podanej formie (W jezyku polskim!!!).
const tchar * common::GetMonthName (MONTH Month, NAME_FORM Form)
 Zwraca nazwę miesiąca w podanej formie (W jezyku polskim!!!).
void common::DateToStr (tstring *Out, const TMSTRUCT &tm, const tstring &Format)
 Konwertuje datę na łańcuch.
WEEKDAY common::StrToWeekDay (const tstring &s)
 Konwertuje łańcuch na dzień tygodnia. Łańcuch może być w dowolnej formie.
MONTH common::StrToMonth (const tstring &s)
 Konwertuje łańcuch na miesiąc. Łańcuch może być w dowolnej formie.
bool common::StrToDate (TMSTRUCT *Out, const tstring &s, const tstring &Format)
 Konwertuje łańcuch na datę.
GameTime common::operator* (int8 v, const GameTime &t)
GameTime common::GetCurrentGameTime ()
GameTime common::MillisecondsToGameTime (int Milliseconds)
GameTime common::MillisecondsToGameTime (int8 Milliseconds)
GameTime common::SecondsToGameTime (float Seconds)
GameTime common::SecondsToGameTime (double Seconds)

Variables

const tchar *const common::DEFAULT_FORMAT
 Domyślny format dla StrToDate() i DateToStr().

Detailed Description

Dokumentacja: Module_DateTime
Nagłówek: DateTime.hpp


Enumeration Type Documentation

Miesiąc roku.

Enumerator:
JAN 
FEB 
MAR 
APR 
MAY 
JUN 
JUL 
AUG 
SEP 
OCT 
NOV 
DEC 
INV_MONTH 

Flagi bitowe - należy połączyć razem flagę SHORT/LONG z flagą LOWERCASE/FIRST_UPPERCASE/UPPERCASE lub użyć jednej z już połączonych.

Enumerator:
NAME_SHORT 
NAME_LONG 
NAME_LOWERCASE 
NAME_FIRST_UPPERCASE 
NAME_UPPERCASE 
NAME_SHORT_LOWERCASE 
NAME_SHORT_FIRST_UPPERCASE 
NAME_SHORT_UPPERCASE 
NAME_LONG_LOWERCASE 
NAME_LONG_FIRST_UPPERCASE 
NAME_LONG_UPPERCASE 

Dzień tygodnia.

Enumerator:
SUN 
MON 
TUE 
WED 
THU 
FRI 
SAT 
INV_WEEKDAY 

Function Documentation

void common::DateToStr ( tstring *  Out,
const TMSTRUCT &  tm,
const tstring &  Format 
)

Konwertuje datę na łańcuch.

int common::GetCentury ( int  Year  )  [inline]

Zwraca wiek podanego roku.

GameTime common::GetCurrentGameTime (  ) 
const tchar* common::GetMonthName ( MONTH  Month,
NAME_FORM  Form 
)

Zwraca nazwę miesiąca w podanej formie (W jezyku polskim!!!).

uint common::GetNumOfDaysInMonth ( int  Year,
uint  Month 
)

Zwraca liczbę dni w podanym miesiącu podanego roku.

uint common::GetNumOfDaysInYear ( int  Year  )  [inline]

Zwraca liczbę dni w podanym roku (365 lub 366).

time_t common::GetTimeNow (  ) 

Zwraca bieżącą datę i czas jako time_t.

void common::GetTmNow ( struct tm *  Out  ) 

Zwraca bieżącą datę i czas jako struct tm.

const tchar* common::GetWeekDayName ( WEEKDAY  WeekDay,
NAME_FORM  Form 
)

Zwraca nazwę dnia tygodnia w podanej formie (W jezyku polskim!!!).

bool common::IsLeapYear ( int  Year  )  [inline]

Zwraca true, jeśli podany rok jest przestępny.

GameTime common::MillisecondsToGameTime ( int8  Milliseconds  ) 
GameTime common::MillisecondsToGameTime ( int  Milliseconds  ) 
DATETIME common::Now (  ) 

Zwraca bieżącą datę i czas, dokładność co do sekund.

GameTime common::operator* ( int8  v,
const GameTime &  t 
) [inline]
TIMESPAN common::operator* ( int  n,
const TIMESPAN &  t 
) [inline]
TIMESPAN common::operator* ( const TIMESPAN &  t,
int  n 
) [inline]
DATESPAN common::operator* ( int  n,
const DATESPAN &  ds 
) [inline]
DATESPAN common::operator* ( const DATESPAN &  ds,
int  n 
) [inline]
DATETIME common::operator+ ( const DATETIME &  dt,
const TIMESPAN &  ts 
) [inline]
TMSTRUCT common::operator+ ( const TMSTRUCT &  tm,
const DATESPAN &  ds 
) [inline]
TIMESPAN common::operator+ ( const TIMESPAN &  t1,
const TIMESPAN &  t2 
) [inline]
DATESPAN common::operator+ ( const DATESPAN &  ds1,
const DATESPAN &  ds2 
) [inline]
DATETIME common::operator- ( const DATETIME &  dt,
const TIMESPAN &  ts 
) [inline]
TIMESPAN common::operator- ( const DATETIME &  dt1,
const DATETIME &  dt2 
) [inline]
TMSTRUCT common::operator- ( const TMSTRUCT &  tm,
const DATESPAN &  ds 
) [inline]
TIMESPAN common::operator- ( const TIMESPAN &  t1,
const TIMESPAN &  t2 
) [inline]
DATESPAN common::operator- ( const DATESPAN &  ds1,
const DATESPAN &  ds2 
) [inline]
GameTime common::SecondsToGameTime ( double  Seconds  ) 
GameTime common::SecondsToGameTime ( float  Seconds  ) 
bool common::StrToDate ( TMSTRUCT *  Out,
const tstring &  s,
const tstring &  Format 
)

Konwertuje łańcuch na datę.

Jeśli się nie uda, zwraca false. Żeby to miało sens, muszą się znaleźć tam co najmniej rok, miesiąc i dzień.

MONTH common::StrToMonth ( const tstring &  s  ) 

Konwertuje łańcuch na miesiąc. Łańcuch może być w dowolnej formie.

Jeśli się nie uda, zwraca INV_WEEKDAY.

WEEKDAY common::StrToWeekDay ( const tstring &  s  ) 

Konwertuje łańcuch na dzień tygodnia. Łańcuch może być w dowolnej formie.

Jeśli się nie uda, zwraca INV_WEEKDAY.

DATETIME common::UNow (  ) 

Zwraca bieżącą datę i czas, dokładność co do milisekund.


Variable Documentation

Domyślny format dla StrToDate() i DateToStr().


Generated on Wed Dec 16 20:44:53 2009 for CommonLib by  doxygen 1.6.1