MoSync 3.3
MAPUtil::DateTime Class Reference

DateTime is a C++ class for time stamps. More...

#include <MAP/DateTime.h>

List of all members.

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 ()

Detailed Description

DateTime is a C++ class for time stamps.


Constructor & Destructor Documentation

Constructs a DateTime with default value.

Constructs a DateTime from the specified ticks.

Ticks is the number of seconds since the beginning of January 1, 1970.

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.


Member Function Documentation

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

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

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

returns current local time as a DateTime.

Referenced by MAP::MapTile::stamp().

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

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

Returns time of day as a TimeSpan from midnight.

Returns the year component of a DateTime.

Returns the month component of a DateTime.

Returns the weekday component of a DateTime.

Returns the day of month component of a DateTime.

Returns the hour component of a DateTime.

Returns the minute component of a DateTime.

Returns the second component of a DateTime.

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.

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

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

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines