码迷,mamicode.com
首页 > 其他好文 > 详细

调用系统时间

时间:2017-05-20 01:13:18      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:div   clu   时间   local   pause   alt   oca   int   code   

VS中编译通过:

#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main()
{
    printf("This is a test!\n");
    time_t rawtime;
    rawtime = time(NULL);
    struct tm *systime = localtime(&rawtime);
    printf("Time is: %s", asctime(systime));
    system("pause");
}

调用系统时间

标签:div   clu   时间   local   pause   alt   oca   int   code   

原文地址:http://www.cnblogs.com/stephjusky/p/6880680.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!