boost-date-time

    6熱度

    1回答

    下面的代碼給出了g ++ - 4.7.0的編譯錯誤,但是用g ++ - 4.6編譯得很好。 #include <iostream> #include <boost/date_time/local_time/local_time.hpp> using namespace std; int main(){ boost::posix_time::ptime time_t_epoch(bo

    2熱度

    1回答

    這裏是我的說明問題,最小expample一些C++代碼: // uncomment the next line, to make it hang up: //#define BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG //needed for nanosecond support of boost #include <boost/thread.hpp> voi

    0熱度

    1回答

    奇怪的是, std::cout << boost::posix_time::from_iso_string("20120927T062299");// 99 seconds! 2012-Sep-27 06:23:39產量,即溢流秒包裝到下一分鐘。這是否真的是一種預期的行爲?如果是這樣,在這種情況下如何強制功能失效?

    7熱度

    2回答

    const boost::posix_time::ptime now= boost::posix_time::second_clock::local_time(); year_ = now.date().year(); month_ = now.date().month(); day_ = now.date().day(); 這是我如何得到boost :: posix_time ::

    0熱度

    2回答

    隨着Boost日期時間我如何創建一個月字符串填充零前9個月? 所以我需要「05」而不是「5」。 date Date(2012,05,1); string monthStringAsNumber = lexical_cast<string>(date.Month().as_number()); // returns "5" string monthStringAsNumberTwo = d

    1熱度

    1回答

    我正在一個簡單的NLP項目給定一個字符串,各種參數將被確定。 鑑於以下輸入: 07122012 12102012 代碼: string REGEX_DATE = "((\\d{2})/(\\d{2})/(\\d{4}))"; regex expressionFormat(REGEX_DATE); sregex_token_iterator i(input.begin(), input.

    0熱度

    2回答

    Boost中的boost :: gregorian :: from_ * string()解析函數似乎只處理4位數年(導致2位數年份的運行時錯誤)。 什麼是使用boost :: gregorian :: from_ * string()函數來處理兩位數年份的最簡潔的方法? 一種可能性是對日期字符串進行一些預處理,並結合編程規則來添加2000或1900來消毒日期格式,但我不想重新發明輪子並添加太多的

    0熱度

    1回答

    #include "boost/date_time/gregorian/gregorian.hpp" int main() { boost::gregorian::greg_weekday dWeek(boost::date_time::Wednesday); //Code One // warning C4482: nonstandard extension

    0熱度

    2回答

    我使用的boost庫,而且只會用int工作: 但我收到的錯誤: cannot convert »boost::gregorian::date_duration« to »int 什麼我可以做嗎?請幫助,我只是想檢查我的日期是否通過了當前日期。 我得到正確的答案但無法使用。 (range.length()) #include <iostream> #include <boost/date_ti

    2熱度

    1回答

    我試圖使用C++ Boost date_time庫將格式爲「16:43 2012年12月12日」的字符串加載到日期輸入構面爲「% H:%M%B%d,%Y「。 接下來,我想從stringstream創建一個Boost ptime對象,以便我可以進行日期/時間數學計算。 我無法得到它的工作 - 下面是代碼: std::string autoMatchTimeStr(row["message_time"