RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Static Public Member Functions | Static Public Attributes
Datacratic::Date Struct Reference

List of all members.

Public Member Functions

 Date (const ptime &date)
 Date (const Opaque &value)
 Date (int year, int month, int day, int hour=0, int minute=0, int second=0, double fraction=0.0)
 Date (JS::JSValue &value)
 Date (const Json::Value &value)
 Date (const ACE_Time_Value &time)
bool isADate () const
double secondsSinceEpoch () const
std::string print (unsigned seconds_digits=0) const
std::string print (const std::string &format) const
std::string printRfc2616 () const
std::string printClassic () const
bool operator== (const Date &other) const
bool operator!= (const Date &other) const
bool operator< (const Date &other) const
bool operator<= (const Date &other) const
bool operator> (const Date &other) const
bool operator>= (const Date &other) const
double operator- (const Date &other) const
DatesetMin (Date other)
DatesetMax (Date other)
Date quantized (double fraction) const
Datequantize (double fraction)
void addSeconds (double interval)
void addMinutes (double interval)
void addHours (double interval)
void addDays (double interval)
Date plusSeconds (double interval) const
Date plusMinutes (double interval) const
Date plusHours (double interval) const
Date plusDays (double interval) const
double secondsUntil (const Date &other) const
double minutesUntil (const Date &other) const
double hoursUntil (const Date &other) const
double daysUntil (const Date &other) const
double secondsSince (const Date &other) const
double minutesSince (const Date &other) const
double hoursSince (const Date &other) const
double daysSince (const Date &other) const
bool sameDay (const Date &other) const
Date dayStart () const
int hour () const
int minute () const
int second () const
int weekday () const
int dayOfMonth () const
int monthOfYear () const
int year () const
int hourOfWeek () const
double fractionalSeconds () const
long long wholeSecondsSinceEpoch () const
std::string printMonth () const
std::string printWeekday () const
std::string printYearAndMonth () const
size_t hash () const
ACE_Time_Value toAce () const
boost::posix_time::ptime toBoost () const
std::chrono::time_point
< std::chrono::system_clock > 
toStd () const
time_t toTimeT () const
tm toTm () const
void addFromString (std::string)

Static Public Member Functions

static Date fromSecondsSinceEpoch (double numSeconds)
static Date parseSecondsSinceEpoch (const std::string &date)
static Date parseDefaultUtc (const std::string &date)
static Date parseIso8601 (const std::string &date)
static Date notADate ()
static Date positiveInfinity ()
static Date negativeInfinity ()
static Date now ()
static Date nowOld ()
static Date expect_date (ML::Parse_Context &context, const std::string &format)
static bool match_date (ML::Parse_Context &context, Date &date, const std::string &format)
static double expect_time (ML::Parse_Context &context, const std::string &format)
static bool match_time (ML::Parse_Context &context, double &time, const std::string &format)
static Date expect_date_time (ML::Parse_Context &context, const std::string &date_format, const std::string &time_format)
static bool match_date_time (ML::Parse_Context &context, Date &result, const std::string &date_format, const std::string &time_format)
static Date parse_date_time (const std::string &date_time, const std::string &date_format, const std::string &time_format)
static Date fromTimeT (const time_t &time)
static Date fromTm (const tm &t)

Static Public Attributes

static const
boost::posix_time::ptime 
epoch

Detailed Description

Definition at line 44 of file date.h.


Member Function Documentation

void Datacratic::Date::addFromString ( std::string  str)

expects a ^[1-9][0-9]*[SMHd]$ string

Definition at line 915 of file date.cc.

static Date Datacratic::Date::fromTimeT ( const time_t &  time) [inline, static]

Construct from a time_t value.

Definition at line 337 of file date.h.

Date Datacratic::Date::fromTm ( const tm &  t) [static]

Construct from a tm structure.

Definition at line 905 of file date.cc.

Date Datacratic::Date::quantized ( double  fraction) const

Quantize to the given fraction of a second. For example, quantize(0.1) leaves only tenths of a second, whereas quantize(1) quantizes to the nearest second.

Definition at line 201 of file date.cc.

ACE_Time_Value Datacratic::Date::toAce ( ) const

Convert to an ACE compatible time value.

Definition at line 882 of file date.cc.

boost::posix_time::ptime Datacratic::Date::toBoost ( ) const [inline]

Convert to a boost posix time

Definition at line 311 of file date.h.

std::chrono::time_point<std::chrono::system_clock> Datacratic::Date::toStd ( ) const [inline]

Convert to a std::chrono::time_point<std::chrono::system_clock> for the standard timing functions.

Definition at line 322 of file date.h.

time_t Datacratic::Date::toTimeT ( ) const [inline]

Convert to a time_t value (seconds). Rounds fractional seconds down.

Definition at line 331 of file date.h.

tm Datacratic::Date::toTm ( ) const

Convert to a tm structure.

Definition at line 891 of file date.cc.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator