www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin DeSilva <ere...@bigpond.com>
Subject mod_jserv/6136: System Date does not work correctly on servlets
Date Thu, 01 Jun 2000 11:05:34 GMT

>Number:         6136
>Category:       mod_jserv
>Synopsis:       System Date does not work correctly on servlets
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jserv
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Thu Jun 01 04:10:00 PDT 2000
>Originator:     eresha@bigpond.com
>Release:        1.3.12
aix 4.2.1, compiler gcc
For some reason apache jserv does not appear to get the system date correctly. 
The following line of code in my servlet. 

Date curDate = new Date();

incorrectly reports yesterday's date until 10.00am after which it switches over to the correct
date. For example if today is 31/5/00 the date reported in the class Date curDate = new Date()
is 30/5/00 (until 10.00am). At first, I thought this may be a problem with my standard JVM
installation so I tested a normal java application which works fine. Therefore, I guess, it
must be something to do with JVM startup initialisation that mod_jserv does. 
Try the following line of code in any servlet:

Date curDate = new Date();
The problem must be to do with the way the JVM starts up (ie.timezone settings)-but the documentation
does not help in fixing this apparent bug.
 [In order for any reply to be added to the PR database, you need]
 [to include <apbugs@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]

View raw message