Created
January 8, 2010 14:49
-
-
Save btbytes/272087 to your computer and use it in GitHub Desktop.
This file contains 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> | |
#define SIZE 256 | |
int | |
main(int argc, char* argv[]) | |
{ | |
time_t curtime; | |
struct tm *gtime; | |
char buffer[SIZE]; | |
curtime = time(NULL); | |
gtime = gmtime(&curtime); | |
printf("GMT time in standard format: "); | |
fputs(asctime(gtime), stdout); | |
strftime(buffer, SIZE, "\nGMT time in ISO format : %Y-%m-%dT%H:%M:%S\n", gtime); | |
fputs(buffer, stdout); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment