Public Member Functions | Static Public Member Functions

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 (Int iYear, Int iMonth, Int iDayOfMonth, Int iHour, Int iMin, Int iSec)
virtual ~TCalendar ()
Int getSecond () const
Int getMinute () const
Int getHour () const
Int getDayOfWeek () const
Int getDayOfMonth () const
Int getDayOfYear () const
Int getWeekOfYear () const
Int getMonth () const
Int 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 (Int iValue)
void setMinute (Int iValue)
void setHour (Int iValue)
void setDayOfWeek (Int iValue)
void setDayOfMonth (Int iValue)
void setDayOfYear (Int iValue)
void setMonth (Int iValue)
void setYear (Int iValue)
void setDateTime (Int iYear, Int iMonth, Int iDayOfMonth, Int iHour, Int iMin, Int iSec)
void setDate (Int iYear, Int iMonth, Int iDayOfMonth)
void setTime (Int iHour, Int iMin, Int iSec)

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 ( Int  iYear,
Int  iMonth,
Int  iDayOfMonth,
Int  iHour,
Int  iMin,
Int  iSec 
)

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

Parameters:
iYear: Year 1900 - 2xxx
iMonth: Month 1..12
iDayOfMonth: Day of the month 1..31
iHour: hour of the day 0..23
iMin: minutes 0..59
iSec: seconds 0..59
TCalendar::~TCalendar (  ) [virtual]

Destroys the calendar


Member Function Documentation

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
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
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::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::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

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::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
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
Int zeus::TCalendar::getDayOfMonth (  ) const [inline]

returns the day of the calendar date

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

returns the week day of the calendar date

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

returns the day of the year

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

returns the hours of the calendar time

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

returns the minutes of the calendar time

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

returns the month of the calendar date

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

returns the seconds of the calendar time

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

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

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

returns the week number of the year

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

returns the year of the calendar date

void TCalendar::setDate ( Int  iYear,
Int  iMonth,
Int  iDayOfMonth 
)

sets date information

Parameters:
iYear: Year 1900 - 2xxx
iMonth: Month 1..12
iDayOfMonth: Day of the month 1..31
void TCalendar::setDateTime ( Int  iYear,
Int  iMonth,
Int  iDayOfMonth,
Int  iHour,
Int  iMin,
Int  iSec 
)

sets date time information

Parameters:
iYear: Year 1900 - 2xxx
iMonth: Month 1..12
iDayOfMonth: Day of the month 1..31
iHour: hour of the day 0..23
iMin: minutes 0..59
iSec: seconds 0..59
void zeus::TCalendar::setDayOfMonth ( Int  iValue ) [inline]

sets the month day of the calendar date

void zeus::TCalendar::setDayOfWeek ( Int  iValue ) [inline]

sets the week day of the calendar date

void zeus::TCalendar::setDayOfYear ( Int  iValue ) [inline]

sets the day of year

void zeus::TCalendar::setHour ( Int  iValue ) [inline]

sets the hours of the calendar time

void zeus::TCalendar::setMinute ( Int  iValue ) [inline]

sets the minutes of the calendar time

void zeus::TCalendar::setMonth ( Int  iValue ) [inline]

sets the month of the calendar date

void zeus::TCalendar::setSecond ( Int  iValue ) [inline]

sets the seconds of the calendar time

void TCalendar::setTime ( Int  iHour,
Int  iMin,
Int  iSec 
)

sets time information

Parameters:
iHour: hour of the day 0..23
iMin: minutes 0..59
iSec: seconds 0..59
void zeus::TCalendar::setYear ( Int  iValue ) [inline]

sets the year of the calendar date


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:28:33