当前位置: 首页>>代码示例>>C++>>正文


C++ time_duration::minutes方法代码示例

本文整理汇总了C++中boost::posix_time::time_duration::minutes方法的典型用法代码示例。如果您正苦于以下问题:C++ time_duration::minutes方法的具体用法?C++ time_duration::minutes怎么用?C++ time_duration::minutes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在boost::posix_time::time_duration的用法示例。


在下文中一共展示了time_duration::minutes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

		boost::posix_time::time_duration Service::GetTimeOfDay( const boost::posix_time::time_duration& value )
		{
			return
				value >= DAY_DURATION ?
				time_duration(value.hours() % 24, value.minutes(), value.seconds()) :
				value
			;
		}
开发者ID:Tisseo,项目名称:synthese,代码行数:8,代码来源:Service.cpp

示例2: to_tm

 //! Convert a time_duration to a tm structure truncating any fractional seconds and zeroing fields for date components 
 inline
 std::tm to_tm(const boost::posix_time::time_duration& td) {
   std::tm timetm = {};
   timetm.tm_hour = date_time::absolute_value(td.hours());
   timetm.tm_min = date_time::absolute_value(td.minutes());
   timetm.tm_sec = date_time::absolute_value(td.seconds());
   timetm.tm_isdst = -1; // -1 used when dst info is unknown
   return timetm;
 }
开发者ID:Azon099,项目名称:ivmp-modules,代码行数:10,代码来源:conversion.hpp

示例3: durationToStr

    std::string durationToStr(const boost::posix_time::time_duration &duration)
    {
        std::stringstream ss;

        ss << std::setfill('0') << std::setw(2) << duration.hours() << ":"
           << std::setfill('0') << std::setw(2) << duration.minutes() << ":"
           << std::setfill('0') << std::setw(2) << duration.seconds();
        return ss.str();
    }
开发者ID:AvS2016,项目名称:ParallelTSP,代码行数:9,代码来源:StopWatch.cpp

示例4: to_tm

 //! Convert a time_duration to a tm structure truncating any fractional seconds and zeroing fields for date components
 inline
 std::tm to_tm(const boost::posix_time::time_duration& td) {
   std::tm timetm;
   std::memset(&timetm, 0, sizeof(timetm));
   timetm.tm_hour = static_cast<int>(date_time::absolute_value(td.hours()));
   timetm.tm_min = static_cast<int>(date_time::absolute_value(td.minutes()));
   timetm.tm_sec = static_cast<int>(date_time::absolute_value(td.seconds()));
   timetm.tm_isdst = -1; // -1 used when dst info is unknown
   return timetm;
 }
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:11,代码来源:conversion.hpp

示例5: EncodeSchedule

		std::string SchedulesBasedService::EncodeSchedule( const boost::posix_time::time_duration& value )
		{
			if(value.is_not_a_date_time())
			{
				return string();
			}

			std::stringstream os;

			os << std::setw( 2 ) << std::setfill ( '0' )
				<< (value.hours() / 24) << ":"
				<< std::setw( 2 ) << std::setfill ( '0' )
				<< (value.hours() % 24) << ":"
				<< std::setw( 2 ) << std::setfill ( '0' )
				<< value.minutes()
				;

			return os.str ();
		}
开发者ID:Tisseo,项目名称:synthese,代码行数:19,代码来源:SchedulesBasedService.cpp

示例6: current_time_string

string current_time_string()  {

  stringstream sstream;
  
  boost::posix_time::ptime now = boost::posix_time::
    microsec_clock::local_time();

    const boost::posix_time::time_duration td = now.time_of_day();
    const long hours        = td.hours();
    const long minutes      = td.minutes();
    const long seconds      = td.seconds();
    const long milliseconds = td.total_milliseconds() -
                              ((hours * 3600 + minutes * 60 + seconds) *
			       1000);
    char buf[40];
    sprintf(buf, "%02ld:%02ld:%02ld.%03ld", 
        hours, minutes, seconds, milliseconds);

    return string(buf);
}
开发者ID:hacoo,项目名称:dougchess-cpp,代码行数:20,代码来源:utility.cpp


注:本文中的boost::posix_time::time_duration::minutes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。