Static Public Member Functions | Static Private 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:
Inheritance graph
[legend]

Static Public Member Functions

static struct::tm * buildTimeInfo (struct timeval *currTime, struct::tm *timeInfo)
 
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 std::string getDateTime (const char *format, const base::SubsecondPrecision *ssPrec)
 Gets current date and time with a subsecond part. 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 microsecond. More...
 
static std::string timevalToString (struct timeval tval, const char *format, const el::base::SubsecondPrecision *ssPrec)
 Converts timeval (struct from ctime) to string using specified format and subsecond precision. More...
 

Static Private Member Functions

static char * parseFormat (char *buf, std::size_t bufSz, const char *format, const struct tm *tInfo, std::size_t msec, const base::SubsecondPrecision *ssPrec)
 

Detailed Description

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

Definition at line 1172 of file easylogging++.h.

Member Function Documentation

struct::tm * DateTime::buildTimeInfo ( struct timeval *  currTime,
struct::tm *  timeInfo 
)
static

Definition at line 1246 of file easylogging++.cc.

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

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

Definition at line 1215 of file easylogging++.cc.

std::string DateTime::getDateTime ( const char *  format,
const base::SubsecondPrecision ssPrec 
)
static

Gets current date and time with a subsecond part.

Parameters
formatUser provided date/time format
ssPrecA pointer to base::SubsecondPrecision from configuration (non-null)
Returns
string based date time in specified format.

Definition at line 1198 of file easylogging++.cc.

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

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

Definition at line 1233 of file easylogging++.cc.

void DateTime::gettimeofday ( struct timeval *  tv)
static

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

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

Parameters
[in,out]tvPointer that gets updated

Definition at line 1171 of file easylogging++.cc.

char * DateTime::parseFormat ( char *  buf,
std::size_t  bufSz,
const char *  format,
const struct tm *  tInfo,
std::size_t  msec,
const base::SubsecondPrecision ssPrec 
)
staticprivate

Definition at line 1272 of file easylogging++.cc.

std::string DateTime::timevalToString ( struct timeval  tval,
const char *  format,
const el::base::SubsecondPrecision ssPrec 
)
static

Converts timeval (struct from ctime) to string using specified format and subsecond precision.

Definition at line 1204 of file easylogging++.cc.


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


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:36