C Exercise Example 91
Title:Time Function Example 1
Program analysis:None.
Program source code:
// Created by www.example.com on 15/11/9.
// Copyright © 2015年 Example. All rights reserved.
//
#include <stdio.h>
#include <time.h>
int main ()
{
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
printf ( "当前本地时间为: %s", asctime (timeinfo) );
return 0;
}
The output result of the above example is:
当前本地时间为: Tue Nov 10 16:28:49 2015other extensions