Programs to interrogate the systems handling of two digit dates --------------------------------------------------------------- Module: getdate.c Description: struct tm *getdate(const char *string); The X/Open CAE Specification, System Interfaces and Headers Issue 4, Version 2 (September 1994), in the entry for getdate() on page 231, states the following with respect to the format code %y: "%y year within century (00-99)" Suppose there is a line of the form "%m/%d/%y" in the template file, and a call is made: struct tm * p_tm; p_tm = getdate( "11/22/02" ); It is not specified what would be represented in the struct tm for the century. This could be interpreted as either 11/22/1902 or 11/22/2002 since the implementation does not know which "century" this is to refer to. This test module has a DATEMSK of "%d/%m/%y" and will call getdate() with a date of "01/01/%2d" where %2d will increment from 00 to 99. The test module will then print out the windows that the getdate() function handles, for example getdate(3C) window: 2000-2068 1969-1999 Note that the Single UNIX Specification only requires that systems be able to represent the time between Jan 1 1970 and Jan 1 2038, thus some systems will have a window of 2000-2038 rather than 2000-2068. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Module: strptime.c Description: char *strptime(const char *buf, const char *format, struct tm *tm); The X/Open CAE Specification, System Interfaces and Headers Issue 4, Version 2 (September 1994), in the entry for strptime() on page 615, states the following with respect to the format code %y: "%y is the year within century [00,99]; leading zeros are permitted but not required" Suppose that the following call is made: struct tm thetime; strptime( "11/22/02", "%m/%d/%y", &thetime ); It is not specified what would be represented in the struct tm for the century. This could be interpreted as either 11/22/1902 or 11/22/2002 since the implementation does not know which "century" this is to refer to. The test module takes a similar strategy to getdate.c. Typical outlook looks like: strptime(3C) window: 2000-2068 1969-1999 or strptime(3C) window: 2000-2038 1969-1999