# MI - Fimex: MetNoFimex::FimexTime Class Reference

# MetNoFimex::FimexTime Class Reference

`#include <TimeUnit.h>`

List of all members.

## Public Types

enum | special_values { min_date_time, max_date_time }

## Public Member Functions

| FimexTime ()
| FimexTime (unsigned short year, char month, char mday, char hour=0, char minute=0, char second=0, unsigned short msecond=0)
| FimexTime (special_values val)
bool | parseISO8601 (const std::string &isoString)
void | setTime (unsigned short year, char month, char mday, char hour=0, char minute=0, char second=0, unsigned short msecond=0)
| set all the time-parameters at once
unsigned short | getYear () const
| year (2008 as of writing)
void | setYear (unsigned short year)
char | getMonth () const
| month (1-12)
void | setMonth (char month)
char | getMDay () const
| day of month (1-31)
void | setMDay (char mday)
char | getHour () const
| hour (0-23)
void | setHour (char hour)
char | getMinute () const
| minute (0-59)
void | setMinute (char minute)
char | getSecond () const
| second (0-59)
void | setSecond (char second)
unsigned short | getMSecond () const
| millisecond
void | setMSecond (unsigned short msecond)
bool | operator== (const FimexTime &rhs) const
| compare two fimexTimes
bool | operator!= (const FimexTime &rhs) const
| compare two fimexTimes
bool | operator> (const FimexTime &rhs) const
| compare two fimexTimes
bool | operator< (const FimexTime &rhs) const
| compare two fimexTimes
bool | operator>= (const FimexTime &rhs) const
| compare two fimexTimes
bool | operator<= (const FimexTime &rhs) const
| compare two fimexTimes

## Detailed Description

time representation and some overloaded operators

Warning:
  : the implementor needs to make sure, that all values are given correctly, i.e. seconds between 0 and 59

## Member Enumeration Documentation

enum MetNoFimex::FimexTime::special_values

Enumerator:

  min_date_time |
  max_date_time |

## Constructor & Destructor Documentation

MetNoFimex::FimexTime::FimexTime | ( |  | ) | `[inline]`

MetNoFimex::FimexTime::FimexTime | ( | unsigned short | year,
|  | char | month,
|  | char | mday,
|  | char | hour = `0`,
|  | char | minute = `0`,
|  | char | second = `0`,
|  | unsigned short | msecond = `0` |
| ) |  |  |

MetNoFimex::FimexTime::FimexTime | ( | special_values | val | ) |

## Member Function Documentation

bool MetNoFimex::FimexTime::parseISO8601 | ( | const std::string & | isoString | ) |

parse and set the time in ISO8601 formats (not all), e.g. YYYY-MM-DD, HH:MM:SS, YYYY-MM-DD HH:MM:SS, YYYY-MM-DDTHH:MM:SS (and without seconds)

Returns:
  true, if time/date has been set, false otherwise

void MetNoFimex::FimexTime::setTime | ( | unsigned short | year,
|  | char | month,
|  | char | mday,
|  | char | hour = `0`,
|  | char | minute = `0`,
|  | char | second = `0`,
|  | unsigned short | msecond = `0` |
| ) |  |  |

set all the time-parameters at once

unsigned short MetNoFimex::FimexTime::getYear | ( |  | ) | const`[inline]`

year (2008 as of writing)

void MetNoFimex::FimexTime::setYear | ( | unsigned short | year | ) | `[inline]`

char MetNoFimex::FimexTime::getMonth | ( |  | ) | const`[inline]`

month (1-12)

void MetNoFimex::FimexTime::setMonth | ( | char | month | ) | `[inline]`

char MetNoFimex::FimexTime::getMDay | ( |  | ) | const`[inline]`

day of month (1-31)

void MetNoFimex::FimexTime::setMDay | ( | char | mday | ) | `[inline]`

char MetNoFimex::FimexTime::getHour | ( |  | ) | const`[inline]`

hour (0-23)

void MetNoFimex::FimexTime::setHour | ( | char | hour | ) | `[inline]`

char MetNoFimex::FimexTime::getMinute | ( |  | ) | const`[inline]`

minute (0-59)

void MetNoFimex::FimexTime::setMinute | ( | char | minute | ) | `[inline]`

char MetNoFimex::FimexTime::getSecond | ( |  | ) | const`[inline]`

second (0-59)

void MetNoFimex::FimexTime::setSecond | ( | char | second | ) | `[inline]`

unsigned short MetNoFimex::FimexTime::getMSecond | ( |  | ) | const`[inline]`

millisecond

void MetNoFimex::FimexTime::setMSecond | ( | unsigned short | msecond | ) | `[inline]`

bool MetNoFimex::FimexTime::operator== | ( | const FimexTime & | rhs | ) | const

compare two fimexTimes

bool MetNoFimex::FimexTime::operator!= | ( | const FimexTime & | rhs | ) | const`[inline]`

compare two fimexTimes

bool MetNoFimex::FimexTime::operator> | ( | const FimexTime & | rhs | ) | const`[inline]`

compare two fimexTimes

References toLong().

bool MetNoFimex::FimexTime::operator< | ( | const FimexTime & | rhs | ) | const`[inline]`

compare two fimexTimes

bool MetNoFimex::FimexTime::operator>= | ( | const FimexTime & | rhs | ) | const`[inline]`

compare two fimexTimes

bool MetNoFimex::FimexTime::operator<= | ( | const FimexTime & | rhs | ) | const`[inline]`

compare two fimexTimes

The documentation for this class was generated from the following file:

- include/fimex/TimeUnit.h