Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Static Public Member Functions | List of all members
Date Class Reference

Date Class. More...

#include <OpenMS/DATASTRUCTURES/Date.h>

Inheritance diagram for Date:
QDate

Public Member Functions

 Date ()
 Default constructor. More...
 
 Date (const Date &date)
 Copy constructor. More...
 
 Date (const QDate &date)
 Copy constructor from Qt base class. More...
 
Dateoperator= (const Date &source)
 Assignment operator. More...
 
void set (const String &date)
 sets data from a string More...
 
void set (UInt month, UInt day, UInt year)
 sets data from three integers More...
 
String get () const
 Returns a string representation of the date. More...
 
void get (UInt &month, UInt &day, UInt &year) const
 Fills the arguments with the date. More...
 
void clear ()
 Sets the undefined date: 00/00/0000. More...
 

Static Public Member Functions

static Date today ()
 Returns the current date. More...
 

Detailed Description

Date Class.

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

Constructor & Destructor Documentation

◆ Date() [1/3]

Date ( )

Default constructor.

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

◆ Date() [2/3]

Date ( const Date date)

Copy constructor.

◆ Date() [3/3]

Date ( const QDate date)

Copy constructor from Qt base class.

Member Function Documentation

◆ clear()

void clear ( )

Sets the undefined date: 00/00/0000.

◆ get() [1/2]

String get ( ) const

Returns a string representation of the date.

Uses the iso/ansi date format: 'yyyy-mm-dd'

◆ get() [2/2]

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

Fills the arguments with the date.

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

◆ operator=()

Date& operator= ( const Date source)

Assignment operator.

◆ set() [1/2]

void set ( const String date)

sets data from a string

The following date formats are supported:

  • mm/dd/yyyy
  • dd.mm.yyyy
  • yyyy-mm-dd
Exceptions
Exception::ParseErroris thrown if the date is given in the wrong format

◆ set() [2/2]

void set ( UInt  month,
UInt  day,
UInt  year 
)

sets data from three integers

Exceptions
Exception::ParseErroris thrown if an invalid date is given

◆ today()

static Date today ( )
static

Returns the current date.


OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:08 using doxygen 1.8.13