Re:Date on Jigsaw

At 5:16 AM 2/8/96, Nick Pollitt wrote:
>In my Jigsaw log files, the month is off by 1 - July logs
>are written as [30/6/1996:16:5:36 +5] and August logs are
>written as [1/7/1996:14:12:54 +5].  Is there any way I can
>fix this.  The OS produces the correct time with the 'date'
>command.

This is a very interesting question. In java Date.getMonth() return zero
based month. That means that January would be 0 and July would be 6. So the
code that just creates a date by combining values from getDate(),
getMonth() an getYear() would fall into this trap. In Jigsaw instance, the
code in CommonLogger is the one that did it.

An easy way to fix it is to edit  w3c.jigsaw.http.CommonLogger line 155, so
it reads {+ "/" + (now.getMonth()+1)} and then recompile the class. You
would have to shut down and restart the server after recompile.

The hard part in here is actually to recompile file and put it back into
.zip file. Send me e-mail, if you don't know how to do it. One notice here,
Jigsaw files were compiled with optimization, so if you miss -O flag,
Jigsaw might run slower... :-{.

It is my belief, that Anselm knows about this bug (feature?) and it is
going to be fixed in the next release.

Hope it helps,
Alex.

alex@access.com.au

Received on Thursday, 1 August 1996 19:19:04 UTC