.TH "shevek::absolute_time" 3 "Wed Jul 9 2014" "libshevek" \" -*- nroff -*- .ad l .nh .SH NAME shevek::absolute_time \- The \fBabsolute_time\fP class stores a date and time\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBabsolute_time\fP ()" .br .RI "\fICreate a new \fBabsolute_time\fP containing the current time\&. \fP" .ti -1c .RI "\fBabsolute_time\fP (unsigned years, unsigned months, unsigned \fBdays\fP, unsigned hours, unsigned minutes, unsigned seconds, unsigned \fBnanoseconds\fP=0)" .br .RI "\fIA specific time\&. \fP" .ti -1c .RI "\fBabsolute_time\fP (timetype seconds, unsigned \fBnanoseconds\fP)" .br .RI "\fIFast constructor\&. \fP" .ti -1c .RI "\fBabsolute_time\fP \fBoperator+\fP (\fBrelative_time\fP that) const " .br .RI "\fIAdd an interval to this moment\&. \fP" .ti -1c .RI "\fBabsolute_time\fP \fBoperator-\fP (\fBrelative_time\fP that) const " .br .RI "\fISubtract an interval from this moment\&. \fP" .ti -1c .RI "\fBrelative_time\fP \fBoperator-\fP (\fBabsolute_time\fP that) const " .br .RI "\fICompute the interval between two moments\&. \fP" .ti -1c .RI "\fBabsolute_time\fP & \fBoperator+=\fP (\fBrelative_time\fP that)" .br .RI "\fIAdd an interval to this moment\&. \fP" .ti -1c .RI "\fBabsolute_time\fP & \fBoperator-=\fP (\fBrelative_time\fP that)" .br .RI "\fISubtract an interval from this moment\&. \fP" .ti -1c .RI "bool \fBoperator<\fP (\fBabsolute_time\fP that) const " .br .RI "\fICompare two moments\&. \fP" .ti -1c .RI "bool \fBoperator>\fP (\fBabsolute_time\fP that) const " .br .RI "\fICompare two moments\&. \fP" .ti -1c .RI "bool \fBoperator<=\fP (\fBabsolute_time\fP that) const " .br .RI "\fICompare two moments\&. \fP" .ti -1c .RI "bool \fBoperator>=\fP (\fBabsolute_time\fP that) const " .br .RI "\fICompare two moments\&. \fP" .ti -1c .RI "bool \fBoperator==\fP (\fBabsolute_time\fP that) const " .br .RI "\fICompare two moments\&. \fP" .ti -1c .RI "bool \fBoperator!=\fP (\fBabsolute_time\fP that) const " .br .RI "\fICompare two moments\&. \fP" .ti -1c .RI "unsigned \fBnanoseconds\fP () const " .br .RI "\fIGet the nanoseconds\&. \fP" .ti -1c .RI "unsigned \fBlocal_second\fP () const " .br .RI "\fIGet the seconds in local time\&. \fP" .ti -1c .RI "unsigned \fBlocal_minute\fP () const " .br .RI "\fIGet the minutes in local time\&. \fP" .ti -1c .RI "unsigned \fBlocal_hour\fP () const " .br .RI "\fIGet the hour in local time\&. \fP" .ti -1c .RI "unsigned \fBlocal_days\fP () const " .br .RI "\fIGet the day of the year in local time, range 0-365\&. \fP" .ti -1c .RI "unsigned \fBlocal_day\fP () const " .br .RI "\fIGet the day of the month in local time, range 1-31\&. \fP" .ti -1c .RI "unsigned \fBlocal_weekday\fP () const " .br .RI "\fIGet the day of the week in local time, range 0-6 where 0 means sunday\&. \fP" .ti -1c .RI "unsigned \fBlocal_month\fP () const " .br .RI "\fIGet the month in local time, range 1-12\&. \fP" .ti -1c .RI "unsigned \fBlocal_year\fP () const " .br .RI "\fIGet the year in local time\&. \fP" .ti -1c .RI "unsigned \fBsecond\fP () const " .br .RI "\fIGet the seconds in UTC\&. \fP" .ti -1c .RI "unsigned \fBminute\fP () const " .br .RI "\fIGet the minutes in UTC\&. \fP" .ti -1c .RI "unsigned \fBhour\fP () const " .br .RI "\fIGet the hour in UTC\&. \fP" .ti -1c .RI "unsigned \fBdays\fP () const " .br .RI "\fIGet the day of the year in UTC, range 0-365\&. \fP" .ti -1c .RI "unsigned \fBday\fP () const " .br .RI "\fIGet the day of the month in UTC, range 1-31\&. \fP" .ti -1c .RI "unsigned \fBweekday\fP () const " .br .RI "\fIGet the day of the week in UTC, range 0-6 where 0 means sunday\&. \fP" .ti -1c .RI "unsigned \fBmonth\fP () const " .br .RI "\fIGet the month in UTC, range 1-12\&. \fP" .ti -1c .RI "unsigned \fByear\fP () const " .br .RI "\fIGet the year in UTC\&. \fP" .ti -1c .RI "timetype \fBtotal\fP () const " .br .RI "\fITotal number of seconds since january 1970, as encoded\&. \fP" .ti -1c .RI "sigc::connection \fBschedule\fP (sigc::slot0< void > callback, Glib::RefPtr< Glib::MainContext > context=Glib::MainContext::get_default())" .br .RI "\fISchedule a callback at a certain time\&. \fP" .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBabsolute_time\fP \fBcreate_from_local\fP (unsigned years, unsigned months, unsigned \fBdays\fP, unsigned hours, unsigned minutes, unsigned seconds, unsigned \fBnanoseconds\fP=0)" .br .RI "\fISemi-constructor which creates a new \fBabsolute_time\fP given a date in local time\&. \fP" .ti -1c .RI "static void \fBset_digits\fP (unsigned num)" .br .RI "\fISet number of digits to use when printing (for fractions of seconds) \fP" .ti -1c .RI "static unsigned \fBget_digits\fP ()" .br .RI "\fIGet the number of digits which is used when printing\&. \fP" .in -1c .SS "Friends" .in +1c .ti -1c .RI "sigc::connection \fBschedule\fP (sigc::slot0< void > callback, int prio, Glib::RefPtr< Glib::MainContext > context)" .br .RI "\fISchedule a callback for when the main loop has time\&. \fP" .ti -1c .RI "std::ostream & \fBoperator<<\fP (std::ostream &s, \fBabsolute_time\fP t)" .br .RI "\fIWrite the time to a std::ostream\&. \fP" .in -1c .SH "Detailed Description" .PP The \fBabsolute_time\fP class stores a date and time\&. Everything is in UTC, except the output of local_* (); .SH "Constructor & Destructor Documentation" .PP .SS "shevek::absolute_time::absolute_time ()" .PP Create a new \fBabsolute_time\fP containing the current time\&. Note that this makes a call to gettimeofday, which is much slower than specifying seconds and nanoseconds\&. Thus, if you need an \fBabsolute_time\fP object to fill with an actual time later, use \fBabsolute_time\fP foo (0, 0); instead of this default constructor\&. .SS "shevek::absolute_time::absolute_time (unsignedyears, unsignedmonths, unsigneddays, unsignedhours, unsignedminutes, unsignedseconds, unsignednanoseconds = \fC0\fP)" .PP A specific time\&. days may be 0-365, with months 0\&. If months > 0, both days and months have a base of 1\&. .SS "shevek::absolute_time::absolute_time (timetypeseconds, unsignednanoseconds)" .PP Fast constructor\&. This directly fills the internal structures\&. It is therefore faster than the other constructors, in particular the default constructor, which makes a kernel call\&. .SH "Member Function Documentation" .PP .SS "static \fBabsolute_time\fP shevek::absolute_time::create_from_local (unsignedyears, unsignedmonths, unsigneddays, unsignedhours, unsignedminutes, unsignedseconds, unsignednanoseconds = \fC0\fP)\fC [static]\fP" .PP Semi-constructor which creates a new \fBabsolute_time\fP given a date in local time\&. The input is the same as for the similar constructor\&. .SS "bool shevek::absolute_time::operator!= (\fBabsolute_time\fPthat) const" .PP Compare two moments\&. Note that this is rarely a useful operation, because minor errors may be introduced by computations\&. In other words: only use this on times which have been set, never on times which have been computed\&. .SS "bool shevek::absolute_time::operator== (\fBabsolute_time\fPthat) const" .PP Compare two moments\&. Note that this is rarely a useful operation, because minor errors may be introduced by computations\&. In other words: only use this on times which have been set, never on times which have been computed\&. .SH "Author" .PP Generated automatically by Doxygen for libshevek from the source code\&.