C Exercise Example 91
100 cases of classic C language
Title: Time Functions Example 1
Program Analysis: None.
Source Code:
// Created by www.w3big.com on 15/11/9. // Copyright © 2015年 本教程. 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; }
Run the above example output is:
当前本地时间为: Tue Nov 10 16:28:49 2015