时间格式化函数strftime
来源:互联网 发布:mac版谷歌dhc插件下载 编辑:程序博客网 时间:2024/05/17 00:51
#include <time.h>
#include <stdio.h>
#include <string.h>
int main()
{
char timebuf[100]={0};
time_t timep;
struct tm *p_tm;
timep = time(NULL);
p_tm = localtime(&timep); /*获取本地时区时间*/
strftime(timebuf, sizeof(timebuf),"%Y-%m-%d %H:%M:%S",p_tm);
printf("%s\n", timebuf);
return 0;
}
结果:2015-06-12 03:44:54
0 0
- 时间格式化函数strftime
- 时间格式化函数--strftime
- strftime() 函数---> 时间格式化
- strftime() 函数将时间格式化
- strftime函数将时间格式化
- strftime函数将时间格式化
- strftime()函数将时间格式化
- strftime()函数将时间格式化
- strftime()函数将时间格式化
- strftime()函数将时间格式化
- strftime()函数将时间格式化
- strftime()函数将时间格式化
- strftime()函数将时间格式化
- C语言格式化输出时间函数strftime()
- strftime()函数将时间格式化
- strftime()函数,C语言时间格式化
- strftime 时间格式化
- linux 时间格式化函数strftime和strptime使用
- 实验内存泄露的检测
- LruDiskCache
- 反射
- FaceBooK/infer-Mac下安装Java分析环境
- 【数据结构】跳跃列表 SkipList
- 时间格式化函数strftime
- Codeforces #186(div 2)D. Ilya and Roads
- LCD12864液晶使用-ST7920
- NIO系列6:流行 NIO Framework netty 和 mina 性能测评与分析
- Invert Binary Tree
- 二分+贪心
- OpenVPN下载、安装、配置及使用详解
- C#类的理解
- 用presentingViewController实现左右切换视图