C语言编程之时间函数举例1

版权声明:此篇博文为博主心血o(╥﹏╥)o,如要转载请注明来源,勿忘心安! https://blog.csdn.net/dyq1995/article/details/88567770

问题描述:使用C语言编程实现时间函数举例。

程序源码:

#include "stdio.h"
#include "time.h"
void main()
{ 
time_t lt; /*define a longint time varible*/
lt=time(NULL);/*system time and date*/
printf(ctime(<)); /*english format output*/
printf(asctime(localtime(<)));/*tranfer to tm*/
printf(asctime(gmtime(<))); /*tranfer to Greenwich time*/
}

猜你喜欢

转载自blog.csdn.net/dyq1995/article/details/88567770
今日推荐