
/*
 *  Copyright 1995 Microsoft Corporation. All rights reserved.
 *  Developed by Ataman Software, Inc., ftp://rmii.com/pub2/ataman,
 *       info@ataman.com
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Library General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public
 *  License along with this library; if not, write to the Free
 *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <stdlib.h>
#include <time.h>

void
main(int argc, char *argv[]) {
	char buf[1024];
	time_t tim = time(0);
	struct tm *tm = localtime(&tim);

	if (argc != 2) {
		exit(1);
	}
	if (strcmp(argv[1], "%D") == 0) {
		strftime(buf, sizeof buf, "%m/%d/%y", tm);
	} else {
		strftime(buf, sizeof buf, argv[1], tm);
	}

	printf("%s", buf);
	exit(0);
}

