Created
January 8, 2013 03:26
-
-
Save enile8/4480931 to your computer and use it in GitHub Desktop.
Display the current local time using C.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <time.h> | |
| int main () | |
| { | |
| time_t rawtime; | |
| struct tm * timeinfo; | |
| time ( &rawtime ); | |
| timeinfo = localtime ( &rawtime ); | |
| printf ( "Current local time and date: %s", asctime (timeinfo) ); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment