Main Page | Class Hierarchy | Class List | Directories | Class Members

osgEphemeris::DateTime Class Reference

Data and methods to store, query and set the current date and time. More...

List of all members.

Public Member Functions

 DateTime ()
 DateTime (const DateTime &dt)
 DateTime (int year, int month, int day, int hour=0, int minute=0, int second=0)
 DateTime (const struct tm &)
void now ()
double getModifiedJulianDate () const
DateTime getGMT () const
void setYear (int year)
int getYear () const
void setMonth (int month)
int getMonth () const
std::string getMonthString () const
void setDayOfMonth (int day)
int getDayOfMonth () const
int getDayOfYear () const
int getDayOfWeek () const
std::string getDayOfWeekString () const
void setHour (int hr)
int getHour () const
void setMinute (int min)
int getMinute () const
void setSecond (int sec)
int getSecond () const
bool isDaylightSavingsTime () const

Static Public Member Functions

static std::string getMonthString (int month)
static std::string getDayOfWeekString (int weekday)


Detailed Description

Data and methods to store, query and set the current date and time.


Constructor & Destructor Documentation

osgEphemeris::DateTime::DateTime  ) 
 

Default Constructor

osgEphemeris::DateTime::DateTime const DateTime dt  ) 
 

Copy Constructor

osgEphemeris::DateTime::DateTime int  year,
int  month,
int  day,
int  hour = 0,
int  minute = 0,
int  second = 0
 

Constructor with parameters

Parameters:
year - Actual year, (not since 1900), e.g. 2006
month - Months numbered from 1 (January) to 12 (December)
day - Day of the month ranges 1 to 31
hour - Hour of the day, ranges 0 - 23
minute - minute of the hour, ranges 0 - 59
second - second of the minute, ranges 0 - 59

osgEphemeris::DateTime::DateTime const struct tm &   ) 
 

Constructor with parameter

Parameters:
struct tm - A filled in struct tm (time.h) structure.


Member Function Documentation

int osgEphemeris::DateTime::getDayOfMonth  )  const
 

Get the day of the month

int osgEphemeris::DateTime::getDayOfWeek  )  const
 

Get the day of the week range 1 - 7 base on the current date.

static std::string osgEphemeris::DateTime::getDayOfWeekString int  weekday  )  [static]
 

Static method to get the name of day of the week with a parameter.

Parameters:
weekday - An integer range 1 - 7.

std::string osgEphemeris::DateTime::getDayOfWeekString  )  const
 

Get an std::string with the name of the day of the week based on the current date.

int osgEphemeris::DateTime::getDayOfYear  )  const
 

Get the day of the year, range 1 - 366 based on the current date.

DateTime osgEphemeris::DateTime::getGMT  )  const
 

Get the Greenwhich Mean Time from the current date and time.

int osgEphemeris::DateTime::getHour  )  const
 

Get the current hour. Returns an integer ranging 0 - 23.

int osgEphemeris::DateTime::getMinute  )  const
 

Get the current minute of the hour. Returns an integer ranging 0 - 59.

double osgEphemeris::DateTime::getModifiedJulianDate  )  const
 

get the Modified Julian Date based on GMT, from the current date and time.

int osgEphemeris::DateTime::getMonth  )  const
 

Get the current month.

static std::string osgEphemeris::DateTime::getMonthString int  month  )  [static]
 

Static method to get the name of a month, based on a parameter.

Parameters:
month - An integer ranging from 1= January to 12 = December.

std::string osgEphemeris::DateTime::getMonthString  )  const
 

Get a std::string representing the name of the current month.

int osgEphemeris::DateTime::getSecond  )  const
 

Get the current second of the minute. Returns an integer ranging 0 - 59.

int osgEphemeris::DateTime::getYear  )  const
 

Get the current year.

bool osgEphemeris::DateTime::isDaylightSavingsTime  )  const
 

Return a boolean value indicating whether the currently set date falls during daylight savings time.

void osgEphemeris::DateTime::now  ) 
 

Set the current date and time to NOW.

void osgEphemeris::DateTime::setDayOfMonth int  day  ) 
 

Set the day of the month.

Parameters:
day - An integer ranging from 1 to 31.

void osgEphemeris::DateTime::setHour int  hr  ) 
 

Set the current hour of the day

Parameters:
hr - An integer ranging 0 - 23.

void osgEphemeris::DateTime::setMinute int  min  ) 
 

Set the current minute of the hour

Parameters:
min - An integer ranging 0 - 59.

void osgEphemeris::DateTime::setMonth int  month  ) 
 

Set the month.

Parameters:
month - An integer ranging from 1= January to 12 = December.

void osgEphemeris::DateTime::setSecond int  sec  ) 
 

Set the current second of the minute

Parameters:
sec - An integer ranging 0 - 59.

void osgEphemeris::DateTime::setYear int  year  ) 
 

Set the current month

Parameters:
year - Actual year, e.g. 2006.


The documentation for this class was generated from the following file:
Generated on Sun Feb 26 20:00:03 2006 for osgEphemeris by  doxygen 1.4.1