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