CppCMS
|
This class represents POSIX time. More...
#include <booster/booster/posix_time.h>
Public Member Functions | |
ptime (long long seconds=0, int nano=0) | |
long long | get_seconds () const |
int | get_nanoseconds () const |
int | get_milliseconds () const |
int | get_microseconds () const |
ptime | operator+ (ptime const &other) const |
ptime & | operator+= (ptime const &other) |
ptime | operator- (ptime const &other) const |
ptime & | operator-= (ptime const &other) |
bool | operator== (ptime const &other) const |
bool | operator!= (ptime const &other) const |
bool | operator< (ptime const &other) const |
bool | operator> (ptime const &other) const |
bool | operator<= (ptime const &other) const |
bool | operator>= (ptime const &other) const |
Static Public Member Functions | |
static long long | seconds (ptime const &p) |
static ptime | seconds (long long v) |
static long long | milliseconds (ptime const &p) |
static ptime | milliseconds (long long v) |
static long long | microseconds (ptime const &p) |
static ptime | microseconds (long long v) |
static long long | nanoseconds (ptime const &p) |
static ptime | nanoseconds (long long v) |
static ptime | minutes (long long v) |
static long long | minutes (ptime const &p) |
static long long | hours (ptime const &p) |
static ptime | hours (long long v) |
static long long | days (ptime const &p) |
static ptime | days (long long v) |
static double | to_number (ptime const &t) |
static ptime | from_number (double d) |
static ptime | local_time (std::tm const &v) |
static ptime | universal_time (std::tm const &v) |
static std::tm | local_time (ptime const &v) |
static std::tm | universal_time (ptime const &v) |
static ptime | now () |
static void | millisleep (long long v) |
static void | nanosleep (long long v) |
static void | sleep (ptime const &v) |
Static Public Attributes | |
static ptime const | zero |
This class represents POSIX time.
The time from Jan 1, 1970 in seconds in UTC (without leap seconds) similar to time_t.
ptime internally holds 64 bit integer for seconds part and int for nanoseconds part which gives fine-grained time representation.
|
inlineexplicit |
Create the POSIX time from seconds and nanoseconds.
References booster::locale::normalize().
|
inlinestatic |
Get amount of full days in p
References get_seconds().
|
inlinestatic |
Convert days v to ptime.
|
inlinestatic |
Convert floating point number d that represents POSIX time in seconds to ptime
|
inline |
Get the microseconds fraction part of POSIX time (which is equal to get_nanoseconds() / 1,000)
|
inline |
Get the milliseconds fraction part of POSIX time (which is equal to get_nanoseconds() / 1,000,000)
Referenced by milliseconds().
|
inline |
Get the nanoseconds fraction part of POSIX time
Referenced by microseconds(), and nanoseconds().
|
inline |
Get the seconds part of POSIX time
Referenced by days(), hours(), microseconds(), milliseconds(), minutes(), and nanoseconds().
|
inlinestatic |
Get amount of full hours in p
References get_seconds().
|
inlinestatic |
Convert hours v to ptime.
|
static |
Convert local time to POSIX time similar to mktime
|
static |
Convert POSIX time v to a local time similar to localtime_r
|
inlinestatic |
Get amount of full microseconds in p. Not the same as p.get_microseconds() as takes seconds as well
References get_nanoseconds(), and get_seconds().
|
inlinestatic |
Convert a microseconds v to ptime.
|
inlinestatic |
Get amount of full milliseconds in p. Not the same as p.get_milliseconds() as takes seconds as well
References get_milliseconds(), and get_seconds().
|
inlinestatic |
Convert a milliseconds v to ptime.
|
inlinestatic |
Sleep at least v milliseconds
|
inlinestatic |
Get amount of full minutes in p
|
inlinestatic |
Convert minutes v to ptime.
References get_seconds().
|
inlinestatic |
Get amount of nanoseconds in p Not the same as p.get_nanoseconds() as takes seconds as well
References get_nanoseconds(), and get_seconds().
|
inlinestatic |
Convert a nanoseconds v to ptime.
|
inlinestatic |
Sleep at least v nanoseconds
References booster::locale::normalize(), and booster::operator>>().
|
static |
Get current time
Add two POSIX time ranges (as numbers)
Add two POSIX time ranges (as numbers)
Subtract one time from other (as number)
Subtract one time from other (as number)
References booster::local_time(), and booster::universal_time().
|
inlinestatic |
Get amount of full seconds in p
|
inlinestatic |
Convert a seconds v to ptime.
|
static |
Sleep at least v amount of time.
|
inlinestatic |
Convert t to floating point number that represents POSIX time in seconds
|
static |
Convert universal time to POSIX time similar to timegm or mktime in GMT timezone
|
static |
Convert POSIX time v to a GMT time similar to gmtime_r