zeus::TCalendar Class Reference

#include <Calendar.h>

Inheritance diagram for zeus::TCalendar:

zeus::TZObject zeus::IZUnknown

List of all members.

Public Member Functions

 TCalendar (bool bLocalTime=true)
 TCalendar (Timeval tmTime, bool bLocalTime=true)
 TCalendar (Uint uiYear, Uint uiMonth, Uint uiDayOfMonth, Uint uiHour, Uint uiMin, Uint uiSec)
virtual ~TCalendar ()
Uint getSecond () const
Uint getMinute () const
Uint getHour () const
Uint getDayOfWeek () const
Uint getDayOfMonth () const
Uint getDayOfYear () const
Uint getWeekOfYear () const
Uint getMonth () const
Uint getYear () const
Timeval getTimeValue ()
TString formatDateTime () const
TString formatDateTime (TLocale &rLocale) const
TString formatDateTime (const IString &rFormat, Int iExpectedLength=200) const
TString formatDate (const TString &rDelimiter) const
TString formatTime (const TString &rDelimiter) const
void setSecond (Uint uiValue)
void setMinute (Uint uiValue)
void setHour (Uint uiValue)
void setDayOfWeek (Uint uiValue)
void setDayOfMonth (Uint uiValue)
void setDayOfYear (Uint uiValue)
void setMonth (Uint uiValue)
void setYear (Uint uiValue)
void setDateTime (Uint uiYear, Uint uiMonth, Uint uiDayOfMonth, Uint uiHour, Uint uiMin, Uint uiSec)
void setDate (Uint uiYear, Uint uiMonth, Uint uiDayOfMonth)
void setTime (Uint uiHour, Uint uiMin, Uint uiSec)

Static Public Member Functions

static TString formatDateTimeForLogger ()
static TString formatDateTimeForLogger (const TCalendar &rCal)
static void convertToMSDOSFormat (Timeval tmValue, Uint16 &rFileDate, Uint16 &rFileTime)
static Timeval convertFromMSDOSFormat (Uint16 usFileDate, Uint16 usFileTime)


Detailed Description

This class implements all calendar and date-time functions. The calendar can be used as a stack object to read all date and time informations.

Constructor & Destructor Documentation

TCalendar::TCalendar ( bool  bLocalTime = true  ) 

Creates a calendar of the current date and time

Parameters:
bLocalTime : falg if time is local or gmt

TCalendar::TCalendar ( Timeval  tmTime,
bool  bLocalTime = true 
)

Creates a calendar of the current date and time

Parameters:
tmTime : time value
bLocalTime : falg if time is local or gmt

TCalendar::TCalendar ( Uint  uiYear,
Uint  uiMonth,
Uint  uiDayOfMonth,
Uint  uiHour,
Uint  uiMin,
Uint  uiSec 
)

Creates a calendar object out of date time information in plain data

Parameters:
uiYear : Year 1900 - 2xxx
uiMonth : Month 1..12
uiDayOfMonth : Day of the month 1..31
uiHour : hour of the day 0..23
uiMin : minutes 0..59
uiSec : seconds 0..59

TCalendar::~TCalendar (  )  [virtual]

Destroys the calendar


Member Function Documentation

Uint zeus::TCalendar::getSecond (  )  const [inline]

returns the seconds of the calendar time

Uint zeus::TCalendar::getMinute (  )  const [inline]

returns the minutes of the calendar time

Uint zeus::TCalendar::getHour (  )  const [inline]

returns the hours of the calendar time

Uint zeus::TCalendar::getDayOfWeek (  )  const [inline]

returns the week day of the calendar date

Uint zeus::TCalendar::getDayOfMonth (  )  const [inline]

returns the day of the calendar date

Uint zeus::TCalendar::getDayOfYear (  )  const [inline]

returns the day of the year

Uint zeus::TCalendar::getWeekOfYear (  )  const [inline]

returns the week number of the year

Uint zeus::TCalendar::getMonth (  )  const [inline]

returns the month of the calendar date

Uint zeus::TCalendar::getYear (  )  const [inline]

returns the year of the calendar date

Timeval zeus::TCalendar::getTimeValue (  )  [inline]

The currently set time for this calendar, expressed in milliseconds after January 1, 1970, 0:00:00 GMT.

TString TCalendar::formatDateTime (  )  const

Formats the calendar date and time into the local date time output. This considers the default locale of the computer settings.

Returns:
formated date time value

TString TCalendar::formatDateTime ( TLocale rLocale  )  const

Formats the calendar date and time into the local date time output using the locale.

Parameters:
rLocale : locale of the requested format
Returns:
formated date time value

TString TCalendar::formatDateTime ( const IString rFormat,
Int  iExpectedLength = 200 
) const

Formats the calendar time into a user specific time output. Following place holders can be used to format the date-time information

  • a: abbreviated weekday name (e.g. Fri)
  • A: full weekday name (e.g. Friday)
  • b: abbreviated month name (e.g. Oct)
  • B: full month name (e.g. October)
  • c: the standard date and time string
  • d: day of the month, as a number (1-31)
  • H: hour, 24 hour format (0-23)
  • I: hour, 12 hour format (1-12)
  • j: day of the year, as a number (1-366)
  • m: month as a number (1-12). Note: some versions of Microsoft Visual C++ may use values that range from 0-11.
  • M: minute as a number (0-59)
  • p: locale's equivalent of AM or PM
  • S: second as a number (0-59)
  • U: week of the year, (0-53), where week 1 has the first Sunday
  • w: weekday as a decimal (0-6), where Sunday is 0
  • W: week of the year, (0-53), where week 1 has the first Monday
  • x: standard date string
  • X: standard time string
  • y: year in decimal, without the century (0-99)
  • Y: year in decimal, with the century
  • Z: time zone name
  • %%: a percent sign The format [d.m.Y H:M:S] will return a date as [23.07.2007 21:22:08].
    Parameters:
    rFormat,: format string
    iExpectedLength : expected length of the formated string (default and minimum is 200 characters)
    Returns:
    formated output

TString TCalendar::formatDate ( const TString rDelimiter  )  const

Formates the calender date into a specific date output using a delimiter

Parameters:
rDelimiter : Delimiter
Returns:
returns the date as year[rDelimiter]month[rDelimiter]day

TString TCalendar::formatTime ( const TString rDelimiter  )  const

Formates the calender time into a specific time output using a delimiter

Parameters:
rDelimiter : Delimiter
Returns:
returns the date as hour[rDelimiter]min[rDelimiter]seconds

void zeus::TCalendar::setSecond ( Uint  uiValue  )  [inline]

sets the seconds of the calendar time

void zeus::TCalendar::setMinute ( Uint  uiValue  )  [inline]

sets the minutes of the calendar time

void zeus::TCalendar::setHour ( Uint  uiValue  )  [inline]

sets the hours of the calendar time

void zeus::TCalendar::setDayOfWeek ( Uint  uiValue  )  [inline]

sets the week day of the calendar date

void zeus::TCalendar::setDayOfMonth ( Uint  uiValue  )  [inline]

sets the month day of the calendar date

void zeus::TCalendar::setDayOfYear ( Uint  uiValue  )  [inline]

sets the day of year

void zeus::TCalendar::setMonth ( Uint  uiValue  )  [inline]

sets the month of the calendar date

void zeus::TCalendar::setYear ( Uint  uiValue  )  [inline]

sets the year of the calendar date

void TCalendar::setDateTime ( Uint  uiYear,
Uint  uiMonth,
Uint  uiDayOfMonth,
Uint  uiHour,
Uint  uiMin,
Uint  uiSec 
)

sets date time information

Parameters:
uiYear : Year 1900 - 2xxx
uiMonth : Month 1..12
uiDayOfMonth : Day of the month 1..31
uiHour : hour of the day 0..23
uiMin : minutes 0..59
uiSec : seconds 0..59

void TCalendar::setDate ( Uint  uiYear,
Uint  uiMonth,
Uint  uiDayOfMonth 
)

sets date information

Parameters:
uiYear : Year 1900 - 2xxx
uiMonth : Month 1..12
uiDayOfMonth : Day of the month 1..31

void TCalendar::setTime ( Uint  uiHour,
Uint  uiMin,
Uint  uiSec 
)

sets time information

Parameters:
uiHour : hour of the day 0..23
uiMin : minutes 0..59
uiSec : seconds 0..59

TString TCalendar::formatDateTimeForLogger (  )  [static]

Formats the time date into a output for loggers (faster than formatDateTime). This will output the time formated like 2005.12.03 12:00:12.

TString TCalendar::formatDateTimeForLogger ( const TCalendar rCal  )  [static]

Formats the time date into a output for loggers (faster than formatDateTime). This will output the time formated like 2005.12.03 12:00:12.

Parameters:
rCal : calendar object to format for logger

void TCalendar::convertToMSDOSFormat ( Timeval  tmValue,
Uint16 rFileDate,
Uint16 rFileTime 
) [static]

Converts the time value into the MSDOS format of file time and file date

Parameters:
tmValue [IN] : time value
rFileDate [OUT] : 16bit file date
rFileTime [OUT] : 16bit file time

Timeval TCalendar::convertFromMSDOSFormat ( Uint16  usFileDate,
Uint16  usFileTime 
) [static]

Converts the MSDOS format of file time and file date into time value

Parameters:
usFileDate : 16bit file date
usFileTime : 16bit file time
Returns:
time value : returns the time value


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


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Wed Oct 28 21:42:34 2009