首页 > 其他 > 详细

time_h && struct tm

时间:2015-07-10 17:00:08      阅读:262      评论:0      收藏:0      [点我收藏+]

/* time_h的使用 */

//第一种方式

time_t timer1;

time(&timer1);

//第二种方式

time_t timer2;

timer2 = time(NULL);

//第三种方式

time_t timer3 = time(NULL);


/*struct tm 的使用*/

struct tm *now;

timer_t timer = time(NULL);

now = localtime(&timer);

printf("%s\n",asctime(now));

printf("%04d",now->tm_year);

printf("%02d",now->tm_mon);

printf("%02d",now->tm_mday);

time_h && struct tm

原文:http://kinghero.blog.51cto.com/10493576/1672807

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!