Skip to content

Instantly share code, notes, and snippets.

@btbytes
Created January 8, 2010 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save btbytes/272087 to your computer and use it in GitHub Desktop.
Save btbytes/272087 to your computer and use it in GitHub Desktop.
#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