Represents absolute times. More...
#include <TimeStamp.h>
Public Member Functions | |
String | formatIso8601 () const |
String | formatIso8601Basic () const |
String | formatIso8601BasicUTC () const |
String | formatIso8601UTC () const |
TimeStamp & | fromNow () |
Set the timestamp to the current system time. More... | |
bool | operator!= (const TimeStamp &other) const |
TimeStamp & | operator+= (const TimeSpan &span) |
Adds a TimeSpan. More... | |
TimeStamp & | operator-= (const TimeSpan &span) |
Substracts a TimeSpan. More... | |
bool | operator< (const TimeStamp &other) const |
bool | operator<= (const TimeStamp &other) const |
bool | operator== (const TimeStamp &other) const |
bool | operator> (const TimeStamp &other) const |
bool | operator>= (const TimeStamp &other) const |
void | strfLocaltime (char *dest, size_t max_len, const char *format) const |
void | strfTime (char *dest, size_t max_len, const char *format) const |
TimeStamp () | |
Standard constructor, creates a null time. More... | |
TimeStamp (uint64_t sec, uint32_t nsec) | |
Constructor, takes a timeval for creation. More... | |
TimeStamp (const struct timespec &ts) | |
TimeStamp (time_t timestamp) | |
uint32_t | tsNSec () const |
uint64_t | tsSec () const |
uint32_t | tsUSec () const |
Static Public Member Functions | |
static TimeStamp | fromIso8601BasicUTC (const String &str) |
static TimeStamp | futureMSec (uint64_t msec) |
Returns a time stamp which lies msec ms in the future. More... | |
static TimeStamp | maxTime () |
static TimeStamp | now () |
Static Public Attributes | |
static const TimeStamp | cZERO |
Private Member Functions | |
TimeStamp & | operator+= (const TimeStamp &other) |
TimeStamp (const TimeBase &base) | |
Additional Inherited Members | |
Protected Member Functions inherited from icl_core::TimeBase | |
void | fromTimespec (const struct timespec &time) |
TimeBase (int64_t secs=0, int32_t nsecs=0) | |
TimeBase (const struct timespec &time) | |
int64_t | days () const |
Use this function if you want to express the time in days. More... | |
int64_t | hours () const |
int32_t | microSeconds () const |
int32_t | milliSeconds () const |
int64_t | minutes () const |
int32_t | nanoSeconds () const |
void | normalizeTime () |
bool | operator!= (const TimeBase &other) const |
TimeBase & | operator+= (const TimeBase &span) |
Adds a TimeSpan. More... | |
TimeBase & | operator-= (const TimeBase &span) |
Substracts a TimeSpan. More... | |
bool | operator< (const TimeBase &other) const |
bool | operator<= (const TimeBase &other) const |
bool | operator== (const TimeBase &other) const |
bool | operator> (const TimeBase &other) const |
bool | operator>= (const TimeBase &other) const |
int64_t | seconds () const |
struct timespec | systemTimespec () const |
int32_t | tbNSec () const |
Returns the nanosecond part of this time. More... | |
int64_t | tbSec () const |
Returns the second part of this time. More... | |
struct timespec | timespec () const |
Static Protected Member Functions inherited from icl_core::TimeBase | |
static TimeBase | maxTime () |
Protected Attributes inherited from icl_core::TimeBase | |
int32_t | nsecs |
int64_t | secs |
Represents absolute times.
Use this class whenever you want to deal with times, as it provides a number of useful operators and functions.
Definition at line 61 of file TimeStamp.h.
|
inline |
Standard constructor, creates a null time.
Definition at line 65 of file TimeStamp.h.
Constructor, takes a timeval for creation.
Constructor that gets a time in seconds plus nanoseconds.
Definition at line 73 of file TimeStamp.h.
|
inline |
Definition at line 77 of file TimeStamp.h.
|
inlineexplicit |
Definition at line 81 of file TimeStamp.h.
|
inlineprivate |
Definition at line 335 of file TimeStamp.h.
String icl_core::TimeStamp::formatIso8601 | ( | ) | const |
Return the TimeStamp as a string in ISO 8601 format, in the local timezone.
Definition at line 221 of file TimeStamp.cpp.
String icl_core::TimeStamp::formatIso8601Basic | ( | ) | const |
Return the TimeStamp as a string in the ISO 8601 basic format (YYYYMMDDTHHMMSS,fffffffff), in the local timezone.
Definition at line 235 of file TimeStamp.cpp.
String icl_core::TimeStamp::formatIso8601BasicUTC | ( | ) | const |
Return the TimeStamp as a string in the ISO 8601 basic format (YYYYMMDDTHHMMSS,fffffffff), in UTC.
Definition at line 249 of file TimeStamp.cpp.
String icl_core::TimeStamp::formatIso8601UTC | ( | ) | const |
Return the TimeStamp as a string in ISO 8601 format, in UTC.
Definition at line 228 of file TimeStamp.cpp.
Returns a time stamp parsed from an ISO 8601 basic UTC timestamp (YYYYMMDDTHHMMSS,fffffffff).
Definition at line 125 of file TimeStamp.cpp.
TimeStamp & icl_core::TimeStamp::fromNow | ( | ) |
Set the timestamp to the current system time.
Definition at line 195 of file TimeStamp.cpp.
Returns a time stamp which lies msec ms in the future.
Definition at line 118 of file TimeStamp.cpp.
|
inlinestatic |
Definition at line 285 of file TimeStamp.h.
|
static |
This static function returns a TimeStamp that contains the current System time (as UTC).
Definition at line 111 of file TimeStamp.cpp.
|
inline |
Compares two variables of type TimeStamp.
true
if they are not equal. Definition at line 233 of file TimeStamp.h.
Adds a TimeSpan.
Definition at line 213 of file TimeStamp.h.
Definition at line 327 of file TimeStamp.cpp.
Substracts a TimeSpan.
Definition at line 222 of file TimeStamp.h.
|
inline |
Compares two variables of type TimeStamp.
true
if the first one is earlier than the second one. Definition at line 250 of file TimeStamp.h.
|
inline |
Compares two variables of type TimeStamp.
true
if the first one is earlier than or equal to the second one. Definition at line 267 of file TimeStamp.h.
|
inline |
Compares two variables of type TimeStamp.
true
if they are equal. Definition at line 241 of file TimeStamp.h.
|
inline |
Compares two variables of type TimeStamp.
true
if the first one is later than the second one. Definition at line 258 of file TimeStamp.h.
|
inline |
Compares two variables of type TimeStamp.
true
if the first one is later than or equal to the second one. Definition at line 276 of file TimeStamp.h.
void icl_core::TimeStamp::strfLocaltime | ( | char * | dest, |
size_t | max_len, | ||
const char * | format | ||
) | const |
Return a formatted time string converted to the local timezone.
Definition at line 211 of file TimeStamp.cpp.
void icl_core::TimeStamp::strfTime | ( | char * | dest, |
size_t | max_len, | ||
const char * | format | ||
) | const |
Return a formatted time string.
Definition at line 203 of file TimeStamp.cpp.
|
inline |
Definition at line 283 of file TimeStamp.h.
|
inline |
Definition at line 281 of file TimeStamp.h.
|
inline |
Definition at line 282 of file TimeStamp.h.
|
static |
Definition at line 332 of file TimeStamp.h.