技术宅,fat-man

增加语言的了解程度可以避免写出愚蠢的代码

导航

2013年9月1日 #

C语言日期时间标准库

摘要: 用思维导图整理:代码:#include #include #include int main(){ /* 标准库直接支持 */ //获得运行程序的机器时间,并直接从time_t打印时间 time_t t = time(NULL); printf("%s\n",ctime(&t)); //从time_t转换成为struct tm,使用struct tm打印时间 struct tm *ptm = localtime(&t); printf("%s\n",asctime(ptm)); //自定义打印时间样式 const int BUF_S... 阅读全文

posted @ 2013-09-01 15:06 codestyle 阅读(1155) 评论(0) 推荐(0)