Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / util / test / dtest.c
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
4 *
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
8 */
9
10 #include <afsconfig.h>
11 #include <afs/param.h>
12
13
14 #include "ktime.h"
15
16 main(argc, argv)
17 int argc;
18 char **argv;
19 {
20 long code, temp;
21 time_t t;
22
23 if (argc <= 1) {
24 printf("dtest: usage is 'dtest <time to interpret>'\n");
25 exit(0);
26 }
27
28 code = ktime_DateToLong(argv[1], &temp);
29 t = temp;
30 if (code) {
31 printf("date parse failed with code %d.\n", code);
32 } else {
33 printf("returned %d, which, run through ctime, yields %s", temp,
34 ctime(&t));
35 }
36 exit(0);
37 }