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

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

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

    printf("%lld = %s",(long long)t, ctime(&t));

    return 0;
}