Re: 4.2.1 Simple Types (java.util.Date)

From: Doug Kohlert <doug.kohlert_at_Sun.COM>
Date: Fri, 30 May 2003 16:21:03 -0700

Yes, Calendar is just more convenient when time is important. Of course
either mapping would work as you pointed out. As you know, you can never
keep all of the people happy all of the time.

ow wrote:
> --- Doug Kohlert <Doug.Kohlert_at_SUN.COM> wrote:
>>The reason this mapping exists is because xsd:dateTime contains both date
>>and time. If the mapping were use java.util.Date, the time would be lost
>>for applications that require the time.
>>If you notice in section 5.3.2, that both Date and Calendar are mapped
>>to xsd:dateTime. Thus if you write an application in Java that uses
>>Date, it will transfer that Date as xsi:dateTime. However, as you have
>>noted, because of the mapping in 4.2.1, clients generated from the WSDL will
>>use Calendar, not Date.
>>I hope this clarifies things for you.
> Thanks for the response. I'm still unclear though why the time would be lost if
> java.util.Date was used. It does contain the number of milliseconds since
> 01/01/1970, so the time could be easily calculated. Or do you mean the time
> cannot be calculated without converting to Calendar?
> Thanks
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).

Doug Kohlert
Java Software Division
Sun Microsystems, Inc.
phone: 503 345-9806