Overall Index -- Gregorian Index -- Posix Time Index
Introduction -- Header -- Class Overview
using namespace boost::gregorian; using namespace boost::posix_time; date d(2000,Jan,20); ptime start(d);//2000-Jan-20 00:00:00 time_iterator titr(start,minutes(15)); //iterate on 15 minute intervals //produces 00:00:00, 00:15:00, 00:30:00, 00:45:00 for (; titr < ptime(d,hour(1)); ++titr) { std::cout << to_simple_string(*titr) << std::endl; }
#include "boost/date_time/posix_time/posix_time.hpp" //include all types plus i/o or #include "boost/date_time/posix_time/posix_time_types.hpp" //no i/o just types
Class | Construction Parameters | Description |
---|---|---|
time_iterator | ptime start_time, time_duration increment | 指定された期間(time_duration)を増分として反復する |