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


"Corcuera,Ron" wrote:
> 
> I've recently started using the Source Code generator.  When I use the
> Marshaller to serialize the Java Object to XML, the Marshaller formats the
> date fields to "2003-10-15T16:42:52.853-04:00" by default with the time zone
> at the end.  We, on the other hand need it in the format
> "2003-10-15T16:42:52.853Z" where Z denotes UTC.  We could also just drop the
> Z so that it is in the format "2003-10-15T16:42:52.853".  I have not found a
> way, yet, to instruct the Marshaller to format the date in any specific way
> other than the default.  Is there some easy way to specify what format the
> Marshaller will use to format the date?
> 
> Thank you.
> 
> -------------------
> Ron Corcuera
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev

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

Reply via email to