代码之家  ›  专栏  ›  技术社区  ›  ABu

值为0的Datetime(在MySQL中)和boost::posix\u time

  •  0
  • ABu  · 技术社区  · 6 年前

    boost::posix_time ,如何获取时间戳( boost::posix_time::ptime

    1 回复  |  直到 6 年前
        1
  •  1
  •   rafix07    6 年前

    这是不可能的。 posix_time::ptime 使用 gregorian::date gregorian date

    当前实施支持1400-Jan-01到1400-Jan-01之间的日期

      boost::posix_time::ptime pt(boost::posix_time::min_date_time);
      cout << pt << endl; // 1400-Jan-01 00:00:00
    

    你会看到的 01年1月14日00:00:00