summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ctime.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ctime.c b/ctime.c
index 5ee8451..437218f 100644
--- a/ctime.c
+++ b/ctime.c
@@ -7,11 +7,15 @@ int main(int argc, char *argv[])
time_t t;
if (argc>1)
- t=(time_t)strtol(argv[1],NULL,0);
+ {
+ t = (time_t)strtoll(argv[1],NULL,0);
+ }
else
- t=time(NULL);
+ {
+ t = time(NULL);
+ }
- printf("%s",ctime(&t));
+ printf("%lld = %s",(long long)t, ctime(&t));
return 0;
}