File: didate.c

package info (click to toggle)
diablo 1.13-1
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 804 kB
  • ctags: 875
  • sloc: ansic: 8,308; perl: 1,908; sh: 186; csh: 81; makefile: 67
file content (29 lines) | stat: -rw-r--r-- 471 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

/*
 * UTIL/DIDATE.C
 *
 * (c)Copyright 1997, Matthew Dillon, All Rights Reserved.  Refer to
 *    the COPYRIGHT file in the base directory of this distribution 
 *    for specific rights granted.
 */

#include "defs.h"

int
main(int ac, char **av)
{
    time_t t;

    if (ac == 1) {
	puts("didate datestr");
	exit(0);
    }
    t = parsedate(av[1]);
    if (t == (time_t)-1) {
	printf("Illegal format\n");
    } else {
	printf("%s", ctime(&t));
    }
    return(0);
}