The DODS Time object
The DODS Time object. This provides a way to translate between various representations of time. This class is designed to be compatible with the DODS\_Date class so that dates and times may be used together in relational expressions. NB: The seconds part of a DODS\_Time may contain fractional components. To test for equality of times, this class tests to see if the second time falls within a neighborhood around the first time the size of which is determined by an epsilon value (1.0e-6 by default). Thus seconds may have precision down to the micro-second (depending on the underlying hardware). See the #set_epsilon()# and #get_epsilon()# mfuncs. The epsilon value is a static class member; the same value is used for all instances of the class, and when changed, is changed at that time for all instances.
DODS_Time(BaseType *arg)
DODS_Time(int hh, int mm, bool gmt = false)
mm - The minutes, 0-59.
gmt - True if the time is a GMT time, false otherwise. DODS_Time(int hh, int mm, double ss, bool gmt = false)
mm - The minutes, 0--59.
ss - The seconds, 0--59. May contain a fractional component.
gmt - True if the time is a GMT time, false otherwise. DODS_Time()
void set(BaseType *arg)
void set(int hh, int mm, bool gmt = false)
mm - The minutes, 0-59.
gmt - True if the time is a GMT time, false otherwise.
void set(int hh, int mm, double ss, bool gmt = false)
mm - The minutes, 0--59.
ss - The seconds, 0--59. May contain a fractional component.
gmt - True if the time is a GMT time, false otherwise.
int hours() const
int minutes() const
double seconds() const
bool gmt() const
double seconds_since_midnight() const
friend int operator!=(DODS_Time &t1, DODS_Time &t2)
friend int operator<(DODS_Time &t1, DODS_Time &t2)
friend int operator>(DODS_Time &t1, DODS_Time &t2)
friend int operator<=(DODS_Time &t1, DODS_Time &t2)
friend int operator>=(DODS_Time &t1, DODS_Time &t2)
double get_epsilon() const
void set_epsilon(double eps)
alphabetic index hierarchy of classes
generated by doc++