Hey all,
We're using castor in an environment where there is likely to be more than
"user time zone" and we'd like to convert our java dates into the user's
timezone when we marshal.  I found the thread that discusses setting the
default TimeZone on DateFieldHandler.  This looks right on point, but it
seems like it may not be safe in our case, since different users might have
different timezones.  With a bunch of different threads going in the
appserver machine (most of which will result in a marshal call) would it
work to set the static default timzone immediately before marshalling?  Or
would we run the risk of crossing wires when things got busy?

Josh


-----Original Message-----
From: Keith Visco [ mailto:[EMAIL <mailto:%5BEMAIL> PROTECTED]
Sent: Thursday, October 16, 2003 1:01 AM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Help with the way Marshaller formats a date
field




Hi Ron,

You can set the default TimeZone to UTC as such:

import org.exolab.castor.xml.handlers.DateFieldHandler;

...

DateFieldHandler.setDefaultTimeZone(TimeZone.getTimeZone("UTC"));

..

Just do that before you call the Marshaller and it should work for you.

--Keith



*********************************************************************
The information contained in this e-mail message is intended only for the
personal and confidential use of the recipient(s) named above. If the reader
of this message is not the intended recipient or an agent responsible for
delivering it to the intended recipient, you are hereby notified that you
have received this document in error and that any review, dissemination,
distribution, or copying of this message is strictly prohibited. If you have
received this communication in error, please notify us immediately by
e-mail, and delete the original message.
*********************************************************************

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to