/***************
*
* g:\exe\txl\src\txltime.c
*/
#include "txl.h"

void settime(char *tmstr)
{
	int hour, minute, second;
	struct dostime_t stm;

	if (sscanf(tmstr, "%02d:%02d:%02d", &hour, &minute, &second) < 3) {
		Exit(1);
	}
	stm.hour = hour;
	stm.minute = minute;
	stm.second = second;
	stm.hsecond = 0;
	_dos_settime(&stm);
}

void setdate(char *dtstr)
{
	int year, month, day;
	struct dosdate_t sdt;

	if (sscanf(dtstr, "%02d/%02d/%02d", &year, &month, &day) < 3) {
		Exit(1);
	}
	sdt.year = year + 1900;
	if (sdt.year < 1980) {
		sdt.year += 100;
	}
	sdt.month = month;
	sdt.day = day;
	sdt.dayofweek = 0;
	_dos_setdate(&sdt);
}

