Jost Martin wrote:
> use.own 100/01/11 13:47:16
>
> Oops - Y2K was here ! Is this a problem of tcl8.0.4 or of module itself ?
> (Ok, this problem is really minor)
>
This is a pretty simple problem to fix. Here is the patch I made to
Modules-3.0pre. I converted to a four-digit year, and added 1900 to
tm->tm_year. If you look at the man pages (Solaris at least) you will see that
tm_year is defined as the number of years since 1900. Another possible, and
unrelated change would be to replace gmtime() with localtime().
*** ModuleCmd_Avail.c.orig Mon Jan 3 11:13:43 2000
--- ModuleCmd_Avail.c Mon Jan 3 11:14:07 2000
***************
*** 1495,1502 ****
**/
if((struct tm *) NULL != (tm = gmtime( &stats.st_mtime))) {
! sprintf( buffer, "%02d/%02d/%02d %2d:%02d:%02d",
! tm->tm_year, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
tm->tm_min, tm->tm_sec);
timestr = buffer;
--- 1495,1502 ----
**/
if((struct tm *) NULL != (tm = gmtime( &stats.st_mtime))) {
! sprintf( buffer, "%04d/%02d/%02d %2d:%02d:%02d",
! tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour,
tm->tm_min, tm->tm_sec);
timestr = buffer;
--
Jonathan Miner - Lockheed Martin EIS/SAI
LM-Xpress: jon...@lm...
Phone: 603 885 UNIX - Fax: 603 885 3850
USmail: PO Box 868, NCA01-3719, Nashua, NH 03061-0868
|