boost之日期date_time
date_time库使用的日期基于格里高利历,支持从1400-01-01到9999-12-31的日期。
空的构造函数会创建一个值为not_a_date_time的无效日期;顺序传入年月日值则创建一个对应日期的date对象。
#include <iostream>
#define BOOST_DATE_TIME_SOURCE
#include <boost/date_time/gregorian/gregorian.hpp>
using namespace boost::gregorian;
using namespace std;
using namespace boost; int main()
{
date d1;//无效的时间
date d2(2013,8,15);//输入年月日
date d3(2014,Aug,15); cout << to_iso_string(d2) <<endl; date d(2010,2,1);
tm t = to_tm(d);//将date转换成tm结构
date d2 = date_from_tm(t)//从tm结构转换成date
//只能转换年月日,时分秒为零
return 0; }
boost之日期date_time的更多相关文章
- boost实现日期时间格式化
#include <iostream> #include<thread> #include<chrono> #include<clocale> #inc ...
- boost 相关
编译boost: 1.打开Microsoft Visual Studio 2010 -> Visual Studio Tools -> Visual Studio Command Prom ...
- boost.log要点笔记
span.kw { color: #007020; font-weight: bold; } code > span.dt { color: #902000; } code > span. ...
- boost学习目录
Boost之数值转换lexical_cast https://www.cnblogs.com/TianFang/archive/2013/02/05/2892506.html Boost之字符串算法s ...
- boost开发指南
C++确实很复杂,神一样的0x不知道能否使C++变得纯粹和干爽? boost很复杂,感觉某些地方有过度设计和太过于就事论事的嫌疑,对实际开发工作的考虑太过于理想化.学习boost本身就是一个复杂度,有 ...
- Boost.log
=================================版权声明================================= 版权声明:本文为博主原创文章 未经许可不得转载 请通过右 ...
- 【转】Python3 日期时间 相关模块(time(时间) / datatime(日期时间) / calendar(日历))
Python3 日期时间 相关模块(time(时间) / datatime(日期时间) / calendar(日历)) 本文由 Luzhuo 编写,转发请保留该信息. 原文: http://blog. ...
- boost.log在项目中应用
//头文件#pragma once #include <string> #include <boost/log/trivial.hpp> using std::string; ...
- Python3 日期时间 相关模块(time(时间) / datatime(日期时间) / calendar(日历))
Python3 日期时间 相关模块(time(时间) / datatime(日期时间) / calendar(日历)) 本文由 Luzhuo 编写,转发请保留该信息. 原文: http://blog. ...
随机推荐
- 记一起和前端没什么卵关系的OPTION 405问题
记一起和前端没什么卵关系的后端405问题 问题的关键点在于本来是POST请求,会变成OPTION请求,并且提示405报错,会类似跨域.并且只有某些手机机型才会(如Oppo系列). 其实跨域的问题,如果 ...
- 自己动手制作更好用的markdown编辑器-03
这里文章都是从个人的github博客直接复制过来的,排版可能有点乱. 原始地址 http://benq.im/2015/04/24/hexomd-03/ 文章目录 1. 系统模块 2. 记录上次打开的 ...
- jQuery中事件绑定
一.前言 最近在做项目中要用到jQuery来绑定事件,首先想到的是$(selector).事件名();这样绑定事件的方式,这种方式对事件进行绑定其实也就是bind()方法,但当选择器匹配的元素过多,$ ...
- WCF 动态调用(1)
很多时候,服务地址都不止一个的,这个时候就要动态去配置地址.配置Web.config,很麻烦 下面就看看怎样实现动态调用WCF. using System; using System.Collecti ...
- vue 组件1
注意:vue组件中的data必须为一个函数,要不vue就会停止工作. 构成组件 组件意味着协同工作,通常父子组件会是这样的关系:组件A在它的模板中使用了组件B,他们之间必然需要相互通信:父组件需要给子 ...
- jquery中Uncaught TypeError: $(...).ajaxUpload is not a function(…)错误解决方法
错误原因:该函数不是jquery的核心函数,所以需要外部引入ajaxfileupload.js文件,可能是没有引入,或者引入的js文件互相冲突 解决方法:每次进入一个函数之前打印该函数所有的js文件, ...
- android学习十四(android的接收短信)
收发短信是每一个手机主要的操作,android手机当然也能够接收短信了. android系统提供了一系列的API,使得我们能够在自己的应用程序里接收和发送短信. 事实上接收短信主要是利用我们前面学过的 ...
- sqlite3 PC安装及使用
sqlite3使用 1. 安装sqlite3 sudo apt-get install sqlite3 sudo apt-get install libsqlite3-dev 2. sqlite常用命 ...
- oracle ora-01652/oracle表空间
参考: oracel bigfile tablespace:(推荐) http://blog.chinaunix.net/uid-20779720-id-3078273.html ora-01652解 ...
- Cut the rope
http://acm.nyist.net/JudgeOnline/problem.php?pid=651 描述We have a rope whose length is L. We will cut ...