reindent-20030715
[openafs.git] / src / kauth / test / test_date.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 /*
11  * Copyright (c) 1985 Regents of the University of California.
12  * All rights reserved.  The Berkeley software License Agreement
13  * specifies the terms and conditions for redistribution.
14  */
15
16 #include <sys/param.h>
17 #include <afsconfig.h>
18
19 RCSID
20     ("$Header$");
21
22 #include <stdio.h>
23 #include <sys/time.h>
24 #include <sys/file.h>
25 #include <errno.h>
26 #include "kautils.h"
27
28 static char *usage = "usage: %s [-n] [-u] [yymmddhhmm[.ss]]\n";
29 main(argc, argv)
30      int argc;
31      char *argv[];
32 {
33     char *progname = argv[0];
34     long time;
35     char bob[30];
36
37     if (argc > 2) {
38         fprintf(stderr, usage, progname);
39         exit(1);
40     }
41
42     if (ktime_DateToLong(argv[1], &time)) {
43         fprintf(stderr, usage, progname);
44         exit(1);
45     } else {
46         ka_timestr(time, bob, KA_TIMESTR_LEN);
47         printf("time is %s\n", bob);
48     }
49
50     exit(0);
51 }