欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
boost 時(shí)間和日期

1 獲取本地時(shí)間:
boost::posix_time::second_clock::local_time();  //當前時(shí)間
date tod = boost::gregorian::day_clock::local_day(); //當前日期
tod += years(1)  // 加1年.

ptime p(boost::gregorian::date(2012,11,01),hours(1)); // 2012年11月1日 凌晨1點(diǎn)整.




2 把字符串轉換為boost 時(shí)間類(lèi)對象:
ptime p1 = from_iso_string("20121101T202020");
ptime p2  = time_from_string("2012-3-5 01:00:00");


3 轉換為時(shí)間字串:
to_simple_string(ptime);
to_iso_string(ptime);
to_iso_extended_string(ptime);








4 boost時(shí)間和其它結構的時(shí)間之間的轉換


boost::gregorian
std::tm to_tm(const date& d)
date date_from_tm(const std::tm& datetm)


boost::posix_time
ptime from_time_t(std::time_t t)
std::tm to_tm(const boost::posix_time::ptime& t)
std::tm to_tm(const boost::posix_time::time_duration& td) 
ptime ptime_from_tm(const std::tm& timetm) 
TimeT from_ftime(const FileTimeT& ft) ///這個(gè)要模版
c_local_adjustor static time_type utc_to_local(const time_type& t)//這個(gè)要模版


5 關(guān)于時(shí)間于時(shí)區
boost::gregorian::date today = boost::gregorian::day_clock::universal_day();
boost::local_time::tz_database tz_db;
tz_db.load_from_file("D:\Library\boost_1_51_0\libs\date_time\data\date_time_zonespec.csv");
boost::local_time::time_zone_ptr shz =tz_db.time_zone_from_region("Asia/Shanghai"); //東八區
boost::local_time::time_zone_ptr cst(new boost::local_time::posix_time_zone("CST+08"));//東八區
boost::local_time::local_date_time dt_bj(today,boost::posix_time::hours(12),shz,false);

//ptime 與地區無(wú)關(guān). local_time 這個(gè)才與地區有關(guān).


//把 東八區上海 時(shí)間轉換為 utc時(shí)間
boost::posix_time::ptime local_to_utc(const boost::posix_time::ptime & local_tm)
{
typedef boost::date_time::local_adjustor< boost::posix_time::ptime, +8, boost::posix_time::no_dst> sct_shz;// 上海 東八區
return sct_shz::local_to_utc(local_tm);
}

本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
boost datetime 時(shí)間處理例程
boost::optional<>
Memory Mapped Files And Shared Memory For C
POSIX正則表達式
OpenSSL函數EVP_EncryptFinal_ex中的內存泄漏
基礎函數
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久