openfluid::core::DateTime Class Reference

Class for management of date and time information. More...

List of all members.

Public Member Functions

 DateTime ()
 DateTime (int Year, int Month, int Day, int Hour, int Minute, int Second)
 DateTime (rawtime_t SecondsSince0000)
 ~DateTime ()
bool set (int Year, int Month, int Day, int Hour, int Minute, int Second)
void set (rawtime_t SecondsSince0000)
bool setFromISOString (wxString DateTimeStr)
bool setFromString (wxString DateTimeStr, wxString Format)
bool setFromwxDateTime (wxDateTime DT)
int getYear () const
int getMonth () const
int getDay () const
int getHour () const
int getMinute () const
int getSecond () const
rawtime_t getRawTime ()
wxString getAsISOString ()
wxString getAsString (wxString Format)
wxString getDateAsISOString ()
wxString getTimeAsISOString ()
wxDateTime getAswxDateTime ()
void addSeconds (rawtime_t Seconds)
void subtractSeconds (rawtime_t Seconds)
rawtime_t diffInSeconds (DateTime DT)
bool isBetween (const DateTime &FirstDT, const DateTime &SecondDT)
bool isStrictlyBetween (const DateTime &FirstDT, const DateTime &SecondDT)
DateTimeoperator= (const DateTime &Right)
bool operator== (const DateTime &Right)
bool operator!= (const DateTime &Right)
bool operator> (const DateTime &Right)
bool operator>= (const DateTime &Right)
bool operator< (const DateTime &Right)
bool operator<= (const DateTime &Right)
DateTime operator+ (const rawtime_t Seconds) const
DateTime operator- (const rawtime_t Seconds) const
bool isSameDate (DateTime DT)
bool isSameTime (DateTime DT)

Static Public Member Functions

static rawtime_t Minute ()
static rawtime_t Minutes (int N)
static rawtime_t Hour ()
static rawtime_t Hours (int N)
static rawtime_t Day ()
static rawtime_t Days (int N)
static rawtime_t Week ()
static rawtime_t Weeks (int N)
static bool isLeapYear (int Year)
static int getNumOfDaysInMonth (int Year, int Month)
static bool isValidDateTime (int Year, int Month, int Day, int Hour, int Minute, int Second)


Detailed Description

Class for management of date and time information.

Class for management of date and time information. It includes arithmetics and comparisons operations.

Sources:


Constructor & Destructor Documentation

openfluid::core::DateTime::DateTime (  ) 

Default constructor

openfluid::core::DateTime::DateTime ( int  Year,
int  Month,
int  Day,
int  Hour,
int  Minute,
int  Second 
)

Constructor

openfluid::core::DateTime::DateTime ( rawtime_t  SecondsSince0000  ) 

Constructor

openfluid::core::DateTime::~DateTime (  ) 

Destructor


Member Function Documentation

bool openfluid::core::DateTime::set ( int  Year,
int  Month,
int  Day,
int  Hour,
int  Minute,
int  Second 
)

Sets the date and time from the parameters

void openfluid::core::DateTime::set ( rawtime_t  SecondsSince0000  ) 

Sets the date and time from the number of seconds since first day of 4713BC

bool openfluid::core::DateTime::setFromISOString ( wxString  DateTimeStr  ) 

Sets the date and time from an ISO formatted string (YYYY-MM-DD hh:mm:ss)

bool openfluid::core::DateTime::setFromString ( wxString  DateTimeStr,
wxString  Format 
)

Sets the date and time from a formatted string (using strptime formatting)

bool openfluid::core::DateTime::setFromwxDateTime ( wxDateTime  DT  ) 

Sets the date and time from a wxDateTime object

int openfluid::core::DateTime::getYear (  )  const [inline]

Returns Year (4 digits)

Returns:
an int

int openfluid::core::DateTime::getMonth (  )  const [inline]

Retourns Month [1-12]

Returns:
an int

int openfluid::core::DateTime::getDay (  )  const [inline]

Returns Day [1-31]

Returns:
an int

int openfluid::core::DateTime::getHour (  )  const [inline]

Returns Hour [0-23]

Returns:
an int

int openfluid::core::DateTime::getMinute (  )  const [inline]

Returns Minute [0-59]

Returns:
an int

int openfluid::core::DateTime::getSecond (  )  const [inline]

Returns Second [0-59]

Returns:
an int

rawtime_t openfluid::core::DateTime::getRawTime (  ) 

Returns date-time in raw format (number of seconds since first day of 4713 BC)

Returns:
a rawtime_t

wxString openfluid::core::DateTime::getAsISOString (  ) 

Returns date-time as string, using format YYYT-MM-DD hh:mm:ss

Returns:
a string

wxString openfluid::core::DateTime::getAsString ( wxString  Format  ) 

Returns date-time as string, using strftime() format string

Parameters:
[in] Format strftime()-like format string
Returns:
a string

wxString openfluid::core::DateTime::getDateAsISOString (  ) 

Returns date as string, using format YYYY-MM-DD

Returns:
a string

wxString openfluid::core::DateTime::getTimeAsISOString (  ) 

Returns time as string, using format hh:mm:ss

Returns:
a string

wxDateTime openfluid::core::DateTime::getAswxDateTime (  ) 

Returns date-time as a wxdateTime object

void openfluid::core::DateTime::addSeconds ( rawtime_t  Seconds  ) 

Adds the given seconds to the current date and time

void openfluid::core::DateTime::subtractSeconds ( rawtime_t  Seconds  ) 

Subtracts the given seconds from the current date and time

rawtime_t openfluid::core::DateTime::diffInSeconds ( DateTime  DT  ) 

Returns the difference in seconds between the date-time and the given date-time (Self - Given)

bool openfluid::core::DateTime::isBetween ( const DateTime FirstDT,
const DateTime SecondDT 
)

Returns true if the date-time is between the two given date-time

bool openfluid::core::DateTime::isStrictlyBetween ( const DateTime FirstDT,
const DateTime SecondDT 
)

Returns true if the date-time is strictly between the two given date-time

DateTime& openfluid::core::DateTime::operator= ( const DateTime Right  ) 

Assignment operator

bool openfluid::core::DateTime::operator== ( const DateTime Right  ) 

Equal operator

bool openfluid::core::DateTime::operator!= ( const DateTime Right  ) 

Difference operator

bool openfluid::core::DateTime::operator> ( const DateTime Right  ) 

Greater than operator

bool openfluid::core::DateTime::operator>= ( const DateTime Right  ) 

Greater than or equal operator

bool openfluid::core::DateTime::operator< ( const DateTime Right  ) 

Lower than operator

bool openfluid::core::DateTime::operator<= ( const DateTime Right  ) 

Lower than or equal operator

DateTime openfluid::core::DateTime::operator+ ( const rawtime_t  Seconds  )  const

Add operator

DateTime openfluid::core::DateTime::operator- ( const rawtime_t  Seconds  )  const

Subtract operator

static rawtime_t openfluid::core::DateTime::Minute (  )  [inline, static]

Returns the number of seconds for one minute

static rawtime_t openfluid::core::DateTime::Minutes ( int  N  )  [inline, static]

Returns the number of seconds for N minutes

static rawtime_t openfluid::core::DateTime::Hour (  )  [inline, static]

Returns the number of seconds for one hour

static rawtime_t openfluid::core::DateTime::Hours ( int  N  )  [inline, static]

Returns the number of seconds for N hours

static rawtime_t openfluid::core::DateTime::Day (  )  [inline, static]

Returns the number of seconds for one day

static rawtime_t openfluid::core::DateTime::Days ( int  N  )  [inline, static]

Returns the number of seconds for N days

static rawtime_t openfluid::core::DateTime::Week (  )  [inline, static]

Returns the number of seconds for one week

static rawtime_t openfluid::core::DateTime::Weeks ( int  N  )  [inline, static]

Returns the number of seconds for N weeks

static bool openfluid::core::DateTime::isLeapYear ( int  Year  )  [static]

Returns true if the given year is a leap year

static int openfluid::core::DateTime::getNumOfDaysInMonth ( int  Year,
int  Month 
) [static]

Returns the number of days in the given month for the given year

static bool openfluid::core::DateTime::isValidDateTime ( int  Year,
int  Month,
int  Day,
int  Hour,
int  Minute,
int  Second 
) [static]

Returns true if the given date time is valid

bool openfluid::core::DateTime::isSameDate ( DateTime  DT  ) 

Returns true if the given date is the same, without comparing time parts

bool openfluid::core::DateTime::isSameTime ( DateTime  DT  ) 

Returns true if the given time is the same, without comparing dates


Generated using Doxygen 1.5.5
Creative Commons License Creative Commons By-NC-ND license