Loading...
Searching...
No Matches
times.h File Reference

datetime_t and date_t objects More...

#include "utils.h"
+ Include dependency graph for times.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ledger::date_duration_t
 
class  ledger::date_error
 
class  ledger::date_interval_t
 
class  ledger::date_range_t
 
class  ledger::date_specifier_or_range_t
 
class  ledger::date_specifier_t
 
struct  ledger::date_traits_t
 
class  ledger::datetime_error
 

Namespaces

namespace  ledger
 

Macros

#define CURRENT_DATE()    (epoch ? epoch->date() : boost::gregorian::day_clock::local_day())
 
#define CURRENT_TIME()   (epoch ? *epoch : TRUE_CURRENT_TIME())
 
#define TRUE_CURRENT_TIME()   (boost::posix_time::second_clock::local_time())
 

Typedefs

typedef boost::gregorian::date_iterator ledger::date_iterator_t
 
typedef boost::gregorian::date ledger::date_t
 
typedef boost::posix_time::ptime ledger::datetime_t
 
typedef datetime_t::time_duration_type ledger::time_duration_t
 

Enumerations

enum  ledger::format_type_t { ledger::FMT_WRITTEN , ledger::FMT_PRINTED , ledger::FMT_CUSTOM }
 

Functions

std::string ledger::format_date (const date_t &when, const format_type_t format_type=FMT_PRINTED, const optional< const char * > &format=none)
 
std::string ledger::format_datetime (const datetime_t &when, const format_type_t format_type=FMT_PRINTED, const optional< const char * > &format=none)
 
bool ledger::is_valid (const date_t &moment)
 
bool ledger::is_valid (const datetime_t &moment)
 
std::ostream & ledger::operator<< (std::ostream &out, const date_duration_t &duration)
 
date_t ledger::parse_date (const char *str)
 
date_t ledger::parse_date (const std::string &str)
 
datetime_t ledger::parse_datetime (const char *str)
 
datetime_t ledger::parse_datetime (const std::string &str)
 
void ledger::put_date (property_tree::ptree &pt, const date_t &when)
 
void ledger::put_datetime (property_tree::ptree &pt, const datetime_t &when)
 
void ledger::set_date_format (const char *format)
 
void ledger::set_datetime_format (const char *format)
 
void ledger::set_input_date_format (const char *format)
 
void ledger::show_period_tokens (std::ostream &out, const string &arg)
 
optional< date_time::weekdays > ledger::string_to_day_of_week (const std::string &str)
 
optional< date_time::months_of_year > ledger::string_to_month_of_year (const std::string &str)
 
void ledger::times_initialize ()
 
void ledger::times_shutdown ()
 

Variables

optional< datetime_tledger::epoch
 
date_time::weekdays ledger::start_of_week
 

Detailed Description

datetime_t and date_t objects

Author
John Wiegley

Definition in file times.h.

Macro Definition Documentation

◆ CURRENT_DATE

#define CURRENT_DATE ( )     (epoch ? epoch->date() : boost::gregorian::day_clock::local_day())

Definition at line 76 of file times.h.

◆ CURRENT_TIME

#define CURRENT_TIME ( )    (epoch ? *epoch : TRUE_CURRENT_TIME())

Definition at line 74 of file times.h.

◆ TRUE_CURRENT_TIME

#define TRUE_CURRENT_TIME ( )    (boost::posix_time::second_clock::local_time())

Definition at line 73 of file times.h.