MAPUtil::DateTime Class Reference

#include <MAP/DateTime.h>

List of all members.


Detailed Description

DateTime is a C++ class for time stamps.


Public Member Functions

 DateTime ()
 DateTime (time_t t)
 DateTime (tm *tim)
 DateTime (int year, int month, int day)
 DateTime (int year, int month, int day, int hour, int minute, int second)
 DateTime (const char *dateString)
 ~DateTime ()
TimeSpan timeOfDay () const
time_t getTicks () const
int getYear () const
int getMonth () const
int getWeekday () const
int getDay () const
int getHour () const
int getMinute () const
int getSecond () const
DateTime add (TimeSpan timeSpan) const
DateTime addYears (int years) const
DateTime addMonths (int months) const
DateTime addDays (double days) const
DateTime addHours (double hours) const
DateTime addMinutes (double minutes) const
DateTime addSeconds (double seconds) const
DateTime addTicks (int ticks) const
TimeSpan subtract (DateTime ts) const
DateTime subtract (TimeSpan span) const

Static Public Member Functions

static DateTime maxValue ()
static DateTime minValue ()
static DateTime now ()
static DateTime today ()


Constructor & Destructor Documentation

MAPUtil::DateTime::DateTime  ) 
 

Constructs a DateTime with default value.

MAPUtil::DateTime::DateTime time_t  t  ) 
 

MAPUtil::DateTime::DateTime tm tim  ) 
 

Constructs a DateTime from the specified tm structure.

MAPUtil::DateTime::DateTime int  year,
int  month,
int  day
 

Constructs a DateTime from the specified year, month, and day. Time of day is set to 00:00:00.

MAPUtil::DateTime::DateTime int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second
 

Constructs a DateTime from the specified year, month, day, hour, minute, and second.

MAPUtil::DateTime::DateTime const char *  dateString  ) 
 

Constructs a DateTime by parsing the specified string.

MAPUtil::DateTime::~DateTime  ) 
 

Destructs a DateTime.


Member Function Documentation

static DateTime MAPUtil::DateTime::maxValue  )  [static]
 

Returns the maximum value that can be represented by a DateTime.

static DateTime MAPUtil::DateTime::minValue  )  [static]
 

Returns the smallest value that can be represented by a DateTime.

static DateTime MAPUtil::DateTime::now  )  [static]
 

returns current local time as a DateTime.

static DateTime MAPUtil::DateTime::today  )  [static]
 

returns today's date in local time, as a DateTime.

TimeSpan MAPUtil::DateTime::timeOfDay  )  const
 

Returns time of day as a TimeSpan from midnight.

time_t MAPUtil::DateTime::getTicks  )  const
 

Returns number of ticks since January 1, 1970. A tick is one second.

int MAPUtil::DateTime::getYear  )  const
 

Returns the year component of a DateTime.

int MAPUtil::DateTime::getMonth  )  const
 

Returns the month component of a DateTime.

int MAPUtil::DateTime::getWeekday  )  const
 

Returns the weekday component of a DateTime.

int MAPUtil::DateTime::getDay  )  const
 

Returns the day of month component of a DateTime.

int MAPUtil::DateTime::getHour  )  const
 

Returns the hour component of a DateTime.

int MAPUtil::DateTime::getMinute  )  const
 

Returns the minute component of a DateTime.

int MAPUtil::DateTime::getSecond  )  const
 

Returns the second component of a DateTime.

DateTime MAPUtil::DateTime::add TimeSpan  timeSpan  )  const
 

Adds a TimeSpan to current value and returns as a new DateTime.

DateTime MAPUtil::DateTime::addYears int  years  )  const
 

Adds specified number of seconds to current value and returns as a new DateTime.

DateTime MAPUtil::DateTime::addMonths int  months  )  const
 

Adds specified number of monts to current value and returns as a new DateTime.

DateTime MAPUtil::DateTime::addDays double  days  )  const
 

Adds specified number of days to current value and returns as a new Datetime.

DateTime MAPUtil::DateTime::addHours double  hours  )  const
 

Adds specified number of hours to current value and returns as a new DateTime.

DateTime MAPUtil::DateTime::addMinutes double  minutes  )  const
 

Adds specified number of minutes to current value and returns as a new DateTime.

DateTime MAPUtil::DateTime::addSeconds double  seconds  )  const
 

Adds specified number of seconds to current value and returns as a new DateTime.

DateTime MAPUtil::DateTime::addTicks int  ticks  )  const
 

Adds ticks to current value and returns as a new DateTime.

TimeSpan MAPUtil::DateTime::subtract DateTime  ts  )  const
 

Returns time span between current value and specified DateTime as a TimeSpan.

DateTime MAPUtil::DateTime::subtract TimeSpan  span  )  const
 

Subtracts a timespan from current value and returns as a new DateTime.


Generated on Sat Feb 13 00:15:38 2010 for MoSync 2 beta 1 by  doxygen 1.4.6-NO