Created
April 14, 2013 08:43
-
-
Save Arkham/5381976 to your computer and use it in GitHub Desktop.
date
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 "../apue.h" | |
#include <time.h> | |
#define BUFSIZE 256 | |
int | |
main(void) | |
{ | |
char result[BUFSIZE]; | |
time_t now; | |
struct tm *ptr; | |
now = time(NULL); | |
ptr = localtime(&now); | |
if (strftime(result, BUFSIZE, "%a %b %d %T %Z %Y", ptr) < 0) | |
err_sys("strftime error"); | |
printf("%s\n", result); | |
exit(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment