README file for y2kmatrix

y2kmatrix -- A command to produce a date matrix for use in testing the 
innate date and time functions in a UNIX system.

BASIS
=====
So many complex functions exist in an operating system's distribution
and much of it is undocumented, or utilized at the core level so
infrequently because we've created front-end interfaces that attempt
to abstract them.  We've done this to build development environments
that will enable high-level programmers to put together useful 
applications in less time.  

In UNIX as in any Operating System environment, these developments have
facilitated the production of software at an exponential rate of growth.
This trend, while useful in enhancing productivity tools, has become
a management problem in the Information Technology sector for those who
have to determine all these applications' interaction with Year 2000, or
Y2K issues.

Some assumptions need to be made to bring this enormous task of evaluating
software for readiness to pass information accurately into the 21st 
century.  

	1.	Developers use common development tools, or at least the
		tools they use have evolved from a common development tool.
	2.	Libraries used by developers and the tools they use are
		common tools.

In the UNIX environment, I'm assuming that the GNU ANSI POSIX C compiler 
has been used to create any executable, library, or object file in making
a useful software tool.  This enables me to focus on one origin for the
resulting myriad programs that have come from this original source of the
date and time (as well as all others) calculations on a UNIX machine.
In short, if it's an application, it got there from C, originally.  

Unfortunately we're in a bit of a trap here in using the native tm struct
and time_t types.  These values are based on the number of seconds from 
the UNIX epoch (1970-01-01), this a 32-bit type with limits at -2147483648
and 2147397248.  This being said, using these native OS time functions 
prevents us from creating dates prior to *1901-12-13 15:45:52 PM EST.  
This is exactly -2^31 seconds before the epoch.  This limitation also 
prevents us from going beyond 2038-01-18 22:14:07 PM EST.

Historically, I've used a matrix of 65000 dates beginning with 1900-01-01.
This is based on having tested Windows (MicroSoft) software which uses a
windowing methodology to determine dates, rather than the sequential
method with reference to the epoch in a UNIX environment.  This matrix
catalogs the weekday, full date, sequential day number within the year, and
numbers of days between a given date and the seed date of 1900-01-01.

Due to the above limitation of the 32-bit date functions in UNIX, I've 
created an algorithm to determine these values prior to and subsequent of
the limiting dates.

VERSION HISTORY
===============
y2kmatrix 1.0.3
Thu Apr  8 14:03:27 EDT 1999
*	Fourth Version.
	Setting up for the conversion to HP-UX.  It did compile fairly cleanly on
	HP-UX in version 1.0.2; however, there was quite a bit of hand editing of
	the sources files.
*	count utility added.
	Creates the informix text file for upload into the hp64 table.

y2kmatrix 1.0.2
Wed Mar 31 15:45:43 EST 1999
*	Third version.  
	Changed the output from terminal (stdout) to a file, y2kmatrix.out.  This 
	will ultimately be used as a diff from the various software matrices'
	output for validation.
*	Created dtloop to populate a text file for building the Informix matrix.
* Created datechg to manipulate the clock on the system.
	Mon Apr  5 17:36:54 EDT 1999
	-Included more intelligent year checking, including allowing for changing of
	dates for the full UNIX epoch, with error checking within one day before it
	ends.  
	-datechg modes:
	-1>	If given no arguments, datechg will print the date in the y2kmatrix date
			coding standard; i.e. 1999-04-07 15:11:07 097 PM EDT. [Wednesday, April
			07, 1999];
	-2>	If given a date formatting specifier, will print a date using the UNIX
	date function; i.e.  datechg +%Y-%m-%d = 1999-04-07;
	-3>	If used in Superuser/Date Change mode; i.e. datechg 199904071600;
			performs validation as described below in Validation details; if not
			root; prints out error messsage.
	-Validation details:
	-1>	Checks that all data is exactly 12 characters yyyymmddHHMM;  on error
			prints out usage message;
	-2>	Checks string to integer conversion to make sure only numbers were
			passed; on error prints out error message;
	-3>	Checks that year is in range 1901 to 2038, inclusive; on error prints
			out date range of the 32-bit UNIX operating system;
	-4>	Checks that month is 1 to 12; on error notifies user to use a valid
			month; 
	-5>	Tests the year and month against the day in the month to determine if
			it's valid; does leap year checking; on error reports to the user that the
			day of the month does not fall within that month;
	-6>	Tests the fully qualified date and time to ensure the user doesn't set
			the time before the valid date range, or beyond 24 hours of the end of the
			valid date range; on error reports the valid UNIX date range; on success
			(i.e. setting the date within 24 hours of the end of the date range, 
			reports that there are 24 hours left for the machine to function), also
			prompts for Yes/No confirmation to change the date;

* Second version.
y2kmatrix 1.0.1
Wed Mar 24 13:20:20 EST 1999
* Second version.
	<monty@monty.pp.sci.fi>	of the MySQL development team on a couple
 	functions they use in calculating dates/times:  sql/time.cc &
	sql/item_timefunc.cc.  These libraries will be used as examples for coding
	of the seed_date logic in main.c
*	Added bit64 to test how many bits the O/S is.
	Wed Mar 24 13:19:26 EST 1999
* Cleaned up the Makefile and made it GNU compliant.

y2kmatrix 1.0.0
Fri Mar 19 13:43:23 1999
*	First version, created the matrix to build dates from 1901/12/13
	20:45:52 GMT to 2038/01/19 03:14:07 GMT.

BUGS
====
Thu Apr  8 14:03:27 EDT 1999
*	Maintaining 2 makefiles for hpux and linux is a pain.  This should be
	replaced with a configure script to determine the host type, but, I don't
	have the time to do this, right now.

Gary Boersma
21st Century Migration Services
gboersm@21ccs.com
www.21ccs.com
/home/vanboers/hp-ux/dates/y2kmatrix-1.0.0/README
Linux cimuxy2k.nsc.bdonet 2.0.36 #1 Tue Oct 13 22:17:11 EDT 1998 i686 unknown
