boost中date_time源码解析

基础组件

date

date
gregorian_calendar_base
gregorian_calendar

time

base_time
split_timedate_system
counted_time_system

microsec_clock

微秒时钟,依赖于模板参数time_type

microsec_clock

time_duration

time_duration
time_resolution_traits

time_resolution_traits

time_resolution_traits

frac_sec_type:表示时间分辨就率特点类型
res:是时间分辨率枚举类型,支持的有

  enum time_resolutions {
    sec,
    tenth,
    hundreth, // deprecated misspelled version of hundredth
    hundredth = hundreth,
    milli,
    ten_thousandth,
    micro,
    nano,
    NumResolutions
  };

resolution_adjust:是frac_sec_type中定义的int_type类型

posix_time使用的是

typedef date_time::time_resolution_traits<
    boost::date_time::time_resolution_traits_adapted64_impl, boost::date_time::micro,
                                            1000000, 6 > time_res_traits

工具

ctime

提供将time_t转为tm,也支持多线程

ctime
std::tm* localtime(const std::time_t* t, std::tm* result)
std::tm* gmtime(const std::time_t* t, std::tm* result)

你可能感兴趣的:(boost,boost)