afsconfig-and-rcsid-all-around-20010705
[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("$Header$");
20
21 #include <stdio.h>
22 #include <sys/time.h>
23 #include <sys/file.h>
24 #include <errno.h>
25 #include "kautils.h"
26
27 static  char *usage = "usage: %s [-n] [-u] [yymmddhhmm[.ss]]\n";
28 main(argc, argv)
29         int argc;
30         char *argv[];
31 {
32         char *progname = argv[0];
33         long time;
34         char bob[30];
35
36         if (argc > 2) {
37                 fprintf(stderr, usage, progname);
38                 exit(1);
39         }
40
41         if (ktime_DateToLong(argv[1], &time)) {
42                 fprintf(stderr, usage, progname);
43                 exit (1);
44         } else {
45             ka_timestr(time,bob,KA_TIMESTR_LEN);
46             printf ("time is %s\n", bob);
47         }
48
49         exit(0);
50 }