Juan,

I'm new at this myself, but my schema has dates, and I tested the generated
java code to marshall and unmarshall.  Also, I examined the API for the
Castor Date.  The internal representation of a date for Castor is
CCYY-MM-DD.  Thus, if you save the value as a Castor Date, it will always be
in the XML in that format.  When you get a date back, you can do one of
several things, two of which come to mind right now.

1.  call the org.exolab.castor.types.Date.toDate() to get back a Java date,
then SimpleDateFormat() it
2. You could use getYear(), getMonth(), getDay() and concat them together
Hope this proves useful.  I suspect the Castor Date is able to take several
"standard" (whatever that is) date formats and properly understand them.  I
used CCYY-MM-DD before I knew it was the internal format, but I suspect
MM/DD/CCYY and MM-DD-CCYY would both be recognized automatically when
setting dates.

> -----Original Message-----
> From: Juan Fuentes [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 1:30 PM
> To:   [EMAIL PROTECTED]
> Subject:      [castor-dev] Using dates in castor
> 
> I know you can map dates with Castor, but how does castor parse dates when
> unmarshaling XML. I need to parse dd-mm-yyyy. Thanks.
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.441 / Virus Database: 247 - Release Date: 1/9/2003
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
> 

------------------------------------------------------------------------------
CONFIDENTIALITY NOTICE: If you have received this e-mail in error, please immediately 
notify the sender by e-mail at the address shown.  This e-mail transmission may 
contain confidential information.  This information is intended only for the use of 
the individual(s) or entity to whom it is intended even if addressed incorrectly.  
Please delete it from your files if you are not the intended recipient.  Thank you for 
your compliance. Copyright (c) 2003 CIGNA

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

Reply via email to