datetimeUtils Class Reference

Miscellaneous functions related to date/time. More...

List of all members.

Static Public Member Functions

static bool isLeapYear (const int year)
static int getDaysInMonth (const int year, const int month)
static const datetime toUniversalTime (const datetime &date)
static const datetime toLocalTime (const datetime &date, const int zone)
static int getDayOfWeek (const int year, const int month, const int day)
static int getWeekOfYear (const int year, const int month, const int day, const bool iso=false)

Detailed Description

Miscellaneous functions related to date/time.


Member Function Documentation

int getDayOfWeek ( const int  year,
const int  month,
const int  day 
) [static]

Return the day of the week from the specified date.

Parameters:
year year in 4-digit format
month month (1-12), January is 1, December is 12 (see datetime::Months enum)
day month day (1-31)
Returns:
the day of the week, Sunday is 0, Monday is 1 (see datetime::DaysOfWeek enum)

References datetimeUtils::getDaysInMonth().

Referenced by datetime::setYear().

int getDaysInMonth ( const int  year,
const int  month 
) [static]

Return the number of days in the specified month.

Parameters:
year year in 4-digit format (this is needed to check for leap years)
month month, January is 1, December is 12 (see datetime::Months enum)
Returns:
the number of days in the month

References datetimeUtils::isLeapYear().

Referenced by datetimeUtils::getDayOfWeek().

int getWeekOfYear ( const int  year,
const int  month,
const int  day,
const bool  iso = false 
) [static]

Return the week number in the year (ISO 8601).

Parameters:
year year in 4-digit format
month month (1-12), January is 1, December is 12 (see datetime::Months enum)
day month day (1-31)
iso if TRUE, use ISO week-numbering year (default is to use calendar year). For more information, read here: http://en.wikipedia.org/wiki/ISO_8601#Week_dates
Returns:
the week number (1 is the first week of the year)

Referenced by datetime::setMonth().

bool isLeapYear ( const int  year  )  [static]

Test whether the specified year is a leap year.

Parameters:
year year in 4-digit format
Returns:
true if year is a leap year, false otherwise

Referenced by datetimeUtils::getDaysInMonth().

const datetime toLocalTime ( const datetime date,
const int  zone 
) [static]

Convert the specified date/time to the specified time zone.

Parameters:
date date/time to convert
zone local zone to convert to (see datetime::TimeZones enum)
Returns:
local time and date

References datetime::getZone(), datetime::GMT, datetime::setZone(), and datetimeUtils::toUniversalTime().

const datetime toUniversalTime ( const datetime date  )  [static]

Convert the specified date/time to UT (GMT).

Parameters:
date date/time to convert
Returns:
GMT date/time

References datetime::getZone(), datetime::GMT, and datetime::setZone().

Referenced by datetimeUtils::toLocalTime().


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

Generated by  doxygen 1.6.2