KVIrc 5.2.0
Developer APIs
Classes | Namespaces | Macros | Enumerations | Functions
KviTimeUtils.h File Reference

Time management. More...

#include "kvi_settings.h"
#include <time.h>
#include <sys/time.h>

Go to the source code of this file.

Classes

class  KviMSecTimeInterval
 A class to retrieve the time interval This works for time intervals a bit longer than 24 days. More...
 

Namespaces

namespace  KviTimeUtils
 Time utilities.
 

Macros

#define kvi_secondsSince(_that_time_t)   kvi_timeSpan(kvi_unixTime(), _that_time_t)
 
#define kvi_time_t   time_t
 
#define kvi_timeSpan(_time_now, _time_before)   ((_time_now) - (_time_before))
 
#define kvi_unixTime()   time(0)
 

Enumerations

enum  KviTimeUtils::FormatTimeSpanFlags { KviTimeUtils::NoLeadingEmptyIntervals = 1 , KviTimeUtils::NoLeadingZeroes = 2 , KviTimeUtils::FillWithHypens = 4 }
 

Functions

QString KviTimeUtils::formatTimeInterval (unsigned int uSeconds, int iFlags=0)
 Returns a string formatted like x d x h xx m xx s.
 
long long KviTimeUtils::getCurrentTimeMills ()
 Returns the current time mills.
 
void kvi_gettimeofday (struct timeval *tmv)
 Gets the time of the day.
 
void KviTimeUtils::secondsToDaysHoursMinsSecs (unsigned int uSecs, unsigned int *uD, unsigned int *uH, unsigned int *uM, unsigned int *uS)
 Splits the time span uSecs in days, hours, minutes and seconds.
 

Detailed Description

Time management.

Author
Szymon Stefanek

Macro Definition Documentation

◆ kvi_secondsSince

#define kvi_secondsSince (   _that_time_t)    kvi_timeSpan(kvi_unixTime(), _that_time_t)

◆ kvi_time_t

#define kvi_time_t   time_t

◆ kvi_timeSpan

#define kvi_timeSpan (   _time_now,
  _time_before 
)    ((_time_now) - (_time_before))

◆ kvi_unixTime

#define kvi_unixTime ( )    time(0)

Function Documentation

◆ kvi_gettimeofday()

void kvi_gettimeofday ( struct timeval *  tmv)
inline