C时间函数
来源:互联网 发布:金百福珠宝软件试用版 编辑:程序博客网 时间:2024/06/05 15:49
C的几个时间函数,写一段小代码,把其全部囊括。
#include <stdio.h>#include <time.h>#include <assert.h>int main(){ time_t now = time(NULL); printf("now utc is %d\n", now); struct tm* gtmie = gmtime(&now); struct tm* ctmie = localtime(&now); time_t now2 = mktime(gtmie ); time_t now3 = mktime(ctmie ); assert (now==now2); assert (now==now3); printf("Time now is %s\n", asctime(gtmie)); printf("Time now is %s\n", asctime(ctmie)); printf("Time now is %s\n", ctime(&now)); char buf[124]; size_t len; len = strftime(buf,124,"%Y-%m-%d %H:%M:%S %Z",gtmie); printf("Time now is %s\n",buf);}
0 0
- C时间函数集
- C时间处理函数
- C时间函数集
- c时间函数
- C语言时间函数
- C时间函数概述
- C时间函数
- c/c++时间函数
- C/C++时间函数
- C/C++时间函数
- c 时间函数
- Linux C 时间函数
- C 的时间函数
- C时间函数集
- C 时间函数
- C/C++时间函数
- Linux C 时间函数
- c语言时间函数
- PopupWindow用法
- 算法 —— 选择排序
- 实现Textbox+listBoxControl拼音检索 C#
- Python数据库ORM SQLAlchemy 0.7学习笔记(3) 会话
- IOS如何解决烦人的“clang: error: linker command failed with exit code 1 (use -v to see invocation)”问题
- C时间函数
- 使用sketch for mac 制作简单的图标
- JavaVisualVM监控远端JAVA程序
- 解题报告 之 HDU5335 Walk Out
- hdoj 5289 线段树
- 主板牌子
- 树莓派开机反馈
- HDU1102 - Constructing Roads 用优先队列优化Prim最小生成树
- AdBlock 插件/傲游浏览器 ABP 广告过滤规则是如何边编写的