Attachment 'unixtime2time.c'
Download 1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <time.h>
4
5 int main (int argc, char *argv[])
6 {
7 if (argc != 2) {
8 fprintf(stderr, "Usage: %s UNIXTIME\n", argv[0]);
9 return 1;
10 }
11 char buffer[256];
12 long int seconds = strtol(argv[1], 0, 10);
13 strftime(buffer, sizeof buffer, "%F, %T", gmtime(&seconds));
14 fprintf(stdout, "%s\n", buffer);
15 return 0;
16 }
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.