summaryrefslogtreecommitdiff
path: root/ctime.c
blob: 5ee84514cf2a85f87f399ebfe9ece44358e5e7e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdlib.h>
#include <stdio.h>
#include <time.h>

int main(int argc, char *argv[])
{
    time_t t;

    if (argc>1)
    	t=(time_t)strtol(argv[1],NULL,0);
    else
    	t=time(NULL);

    printf("%s",ctime(&t));

    return 0;
}