Linux C++ 时间格式化
来源:互联网 发布:阿里云 自己安装系统 编辑:程序博客网 时间:2024/06/05 20:43
/*************************************************************************
> File Name: time.cpp
> Author: chenhui
> Mail: *********
> Created Time: 2016年03月10日 11:20:58
************************************************************************/
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
time_t now_time;
char buf[128] = {0};
tm * local;
now_time=time(NULL);
cout<<now_time<<endl;
cout<<now_time-100<<endl;
local = localtime(&now_time);
strftime(buf, 128,"%Y-%m-%d %H:%M:%S", local);
cout<<"time format:"<<buf<<endl;
return 0;
}
> File Name: time.cpp
> Author: chenhui
> Mail: *********
> Created Time: 2016年03月10日 11:20:58
************************************************************************/
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
time_t now_time;
char buf[128] = {0};
tm * local;
now_time=time(NULL);
cout<<now_time<<endl;
cout<<now_time-100<<endl;
local = localtime(&now_time);
strftime(buf, 128,"%Y-%m-%d %H:%M:%S", local);
cout<<"time format:"<<buf<<endl;
return 0;
}
0 0
- Linux C 获取格式化的日期时间
- Linux C 获取格式化的日期时间
- 【C#】格式化时间
- linux shell 格式化时间
- linux下格式化时间
- Linux C++ 时间格式化
- Linux C语言 格式化输出时间函数 strftime()
- Linux 时间转字符串(格式化时间)
- 用DateTimeFormatInfo格式化日期时间(C#)
- C语言格式化输出时间函数strftime()
- 用c得到格式化的时间-实例
- [object-c]格式化时间
- Objective-C 【格式化日期时间字符串】
- C/C++ 获取格式化时间字符串
- strftime()函数,C语言时间格式化
- C#_格式化输入日期时间
- C语言时间函数time_t格式化打印...
- c 获取当前时间并格式化输出
- C专家编程_笔记备忘
- java 内存模型笔记(一)
- AFN用Post发送Json数据
- 简单web页面支持手机自适应,只需配置一些信息而没有用到bootstrap框架
- c++的overload override overwrite 你真的懂了吗
- Linux C++ 时间格式化
- SSM框架实例
- opencv漫水填充算法cvFloodFill()
- UE4官方文档_间接光照缓存
- Android M新控件之FloatingActionButton,TextInputLayout,Snackbar的使用
- numpy的矩阵运算笔记
- windows 移除java方法
- 1:STL中的内存研究
- 【leetcode】Longest Substring Without Repeating Characters