ifw  0.0.1-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Static Public Member Functions | List of all members
el::base::utils::DateTime Class Reference

Contains utilities for cross-platform date/time. This class make use of el::base::utils::Str. More...

#include <easylogging++.h>

Inheritance diagram for el::base::utils::DateTime:
el::base::StaticClass el::base::StaticClass el::base::StaticClass

Static Public Member Functions

static void gettimeofday (struct timeval *tv)
 Cross platform gettimeofday for Windows and unix platform. This can be used to determine current millisecond. More...
 
static std::string getDateTime (const char *format, const base::MillisecondsWidth *msWidth)
 Gets current date and time with milliseconds. More...
 
static base::type::string_t formatTime (unsigned long long time, base::TimestampUnit timestampUnit)
 Formats time to get unit accordingly, units like second if > 1000 or minutes if > 60000 etc. More...
 
static unsigned long long getTimeDifference (const struct timeval &endTime, const struct timeval &startTime, base::TimestampUnit timestampUnit)
 Gets time difference in milli/micro second depending on timestampUnit. More...
 
static void gettimeofday (struct timeval *tv)
 Cross platform gettimeofday for Windows and unix platform. This can be used to determine current millisecond. More...
 
static std::string getDateTime (const char *format, const base::MillisecondsWidth *msWidth)
 Gets current date and time with milliseconds. More...
 
static base::type::string_t formatTime (unsigned long long time, base::TimestampUnit timestampUnit)
 Formats time to get unit accordingly, units like second if > 1000 or minutes if > 60000 etc. More...
 
static unsigned long long getTimeDifference (const struct timeval &endTime, const struct timeval &startTime, base::TimestampUnit timestampUnit)
 Gets time difference in milli/micro second depending on timestampUnit. More...
 
static void gettimeofday (struct timeval *tv)
 Cross platform gettimeofday for Windows and unix platform. This can be used to determine current millisecond. More...
 
static std::string getDateTime (const char *format, const base::MillisecondsWidth *msWidth)
 Gets current date and time with milliseconds. More...
 
static base::type::string_t formatTime (unsigned long long time, base::TimestampUnit timestampUnit)
 Formats time to get unit accordingly, units like second if > 1000 or minutes if > 60000 etc. More...
 
static unsigned long long getTimeDifference (const struct timeval &endTime, const struct timeval &startTime, base::TimestampUnit timestampUnit)
 Gets time difference in milli/micro second depending on timestampUnit. More...
 

Detailed Description

Contains utilities for cross-platform date/time. This class make use of el::base::utils::Str.

Member Function Documentation

static base::type::string_t el::base::utils::DateTime::formatTime ( unsigned long long  time,
base::TimestampUnit  timestampUnit 
)
inlinestatic

Formats time to get unit accordingly, units like second if > 1000 or minutes if > 60000 etc.

static base::type::string_t el::base::utils::DateTime::formatTime ( unsigned long long  time,
base::TimestampUnit  timestampUnit 
)
inlinestatic

Formats time to get unit accordingly, units like second if > 1000 or minutes if > 60000 etc.

static base::type::string_t el::base::utils::DateTime::formatTime ( unsigned long long  time,
base::TimestampUnit  timestampUnit 
)
inlinestatic

Formats time to get unit accordingly, units like second if > 1000 or minutes if > 60000 etc.

static std::string el::base::utils::DateTime::getDateTime ( const char *  format,
const base::MillisecondsWidth msWidth 
)
inlinestatic

Gets current date and time with milliseconds.

Parameters
formatUser provided date/time format
msWidthA pointer to base::MillisecondsWidth from configuration (non-null)
Returns
string based date time in specified format.
static std::string el::base::utils::DateTime::getDateTime ( const char *  format,
const base::MillisecondsWidth msWidth 
)
inlinestatic

Gets current date and time with milliseconds.

Parameters
formatUser provided date/time format
msWidthA pointer to base::MillisecondsWidth from configuration (non-null)
Returns
string based date time in specified format.
static std::string el::base::utils::DateTime::getDateTime ( const char *  format,
const base::MillisecondsWidth msWidth 
)
inlinestatic

Gets current date and time with milliseconds.

Parameters
formatUser provided date/time format
msWidthA pointer to base::MillisecondsWidth from configuration (non-null)
Returns
string based date time in specified format.
static unsigned long long el::base::utils::DateTime::getTimeDifference ( const struct timeval &  endTime,
const struct timeval &  startTime,
base::TimestampUnit  timestampUnit 
)
inlinestatic

Gets time difference in milli/micro second depending on timestampUnit.

static unsigned long long el::base::utils::DateTime::getTimeDifference ( const struct timeval &  endTime,
const struct timeval &  startTime,
base::TimestampUnit  timestampUnit 
)
inlinestatic

Gets time difference in milli/micro second depending on timestampUnit.

static unsigned long long el::base::utils::DateTime::getTimeDifference ( const struct timeval &  endTime,
const struct timeval &  startTime,
base::TimestampUnit  timestampUnit 
)
inlinestatic

Gets time difference in milli/micro second depending on timestampUnit.

static void el::base::utils::DateTime::gettimeofday ( struct timeval *  tv)
inlinestatic

Cross platform gettimeofday for Windows and unix platform. This can be used to determine current millisecond.

For unix system it uses gettimeofday(timeval*, timezone*) and for Windows, a seperate implementation is provided

Parameters
[in,out]tvPointer that gets updated
static void el::base::utils::DateTime::gettimeofday ( struct timeval *  tv)
inlinestatic

Cross platform gettimeofday for Windows and unix platform. This can be used to determine current millisecond.

For unix system it uses gettimeofday(timeval*, timezone*) and for Windows, a seperate implementation is provided

Parameters
[in,out]tvPointer that gets updated
static void el::base::utils::DateTime::gettimeofday ( struct timeval *  tv)
inlinestatic

Cross platform gettimeofday for Windows and unix platform. This can be used to determine current millisecond.

For unix system it uses gettimeofday(timeval*, timezone*) and for Windows, a seperate implementation is provided

Parameters
[in,out]tvPointer that gets updated

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