Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

DateTime Class Reference
[Datastructures]

#include <OpenMS/DATASTRUCTURES/DateTime.h>

Inheritance diagram for DateTime:

QDateTime

List of all members.


Detailed Description

DateTime Class.

This class implements date handling. Import and export to/from both string and integers is possible.

Public Member Functions

 DateTime ()
 Default constructor.
 DateTime (const DateTime &date)
 Copy constructor.
 DateTime (const QDateTime &date)
 Copy constructor from Qt base class.
DateTimeoperator= (const DateTime &source)
 Assignment operator.
void setDate (const String &date) throw (Exception::ParseError)
 sets date from a string
void setTime (const String &date) throw (Exception::ParseError)
 sets time from a string
void setDate (UInt month, UInt day, UInt year) throw (Exception::ParseError)
 sets data from three integers
void setTime (UInt hour, UInt minute, UInt second) throw (Exception::ParseError)
 sets time from three integers
void set (UInt month, UInt day, UInt year, UInt hour, UInt minute, UInt second) throw (Exception::ParseError)
 sets data from six integers
void get (UInt &month, UInt &day, UInt &year, UInt &hour, UInt &minute, UInt &second) const
 Fills the arguments with the date and the time.
void getDate (UInt &month, UInt &day, UInt &year) const
 Fills the arguments with the date.
void getDate (String &date) const
 Fills the arguments with the date.
void getTime (UInt &hour, UInt &minute, UInt &second) const
 Fills the arguments with the time.
void getTime (String &time) const
 Fills the arguments with the time.
void now ()
 sets instance to actual date and time
void clear ()
 Sets the undefined date: 00/00/0000 00:00:00.
void get (String &date) const
 Fills the argument with the date and time.
void set (const String &date) throw (Exception::ParseError)
 Sets date and time.


Constructor & Destructor Documentation

DateTime (  ) 

Default constructor.

Fills the object with an undefined date: 00/00/0000

DateTime ( const DateTime date  ) 

Copy constructor.

DateTime ( const QDateTime date  ) 

Copy constructor from Qt base class.


Member Function Documentation

DateTime& operator= ( const DateTime source  ) 

Assignment operator.

void setDate ( const String date  )  throw (Exception::ParseError)

sets date from a string

Reads both english, german and iso/ansi date formats: 'mm/dd/yyyy', 'dd.mm.yyyy' or 'yyyy-mm-dd'

void setTime ( const String date  )  throw (Exception::ParseError)

sets time from a string

Reads time format: 'HH:MM:SS'

void setDate ( UInt  month,
UInt  day,
UInt  year 
) throw (Exception::ParseError)

sets data from three integers

Give the numbers in the following order: month, day and year.

void setTime ( UInt  hour,
UInt  minute,
UInt  second 
) throw (Exception::ParseError)

sets time from three integers

Give the numbers in the following order: hour, minute and second.

void set ( UInt  month,
UInt  day,
UInt  year,
UInt  hour,
UInt  minute,
UInt  second 
) throw (Exception::ParseError)

sets data from six integers

Give the numbers in the following order: month, day, year, hour, minute, second.

void get ( UInt month,
UInt day,
UInt year,
UInt hour,
UInt minute,
UInt second 
) const

Fills the arguments with the date and the time.

Give the numbers in the following order: month, day and year, hour minute, second.

void getDate ( UInt month,
UInt day,
UInt year 
) const

Fills the arguments with the date.

Give the numbers in the following order: month, day and year.

void getDate ( String date  )  const

Fills the arguments with the date.

The format of the string will be yyyy-mm-dd

void getTime ( UInt hour,
UInt minute,
UInt second 
) const

Fills the arguments with the time.

The arguments are all UInts and the order is hour minute second

void getTime ( String time  )  const

Fills the arguments with the time.

The format of the string will be hh:mm:ss

void now (  ) 

sets instance to actual date and time

void clear (  ) 

Sets the undefined date: 00/00/0000 00:00:00.

void get ( String date  )  const

Fills the argument with the date and time.

The format of the string will be yyyy-mm-dd hh:mm:ss

void set ( const String date  )  throw (Exception::ParseError)

Sets date and time.

The format of the string is yyyy-mm-dd hh:mm:ss


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:43 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1