You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Su...@united.com on 2004/06/03 00:20:34 UTC

Calendar Problem

Hi,

I have compiled a schema which contains an object 'obj' which has a date 
element. The XMLBeans-generated method will return a Calendar object 
when calling "obj.getDate();".

The code is (where aDate is a Date object):
"aDate.setTime(obj.getDate().getTimeInMillis());"

When I parse the string from an XML input file "2004-05-11 00:00:01.0", 
I receive an error saying 
"com.bea.xbean.values.XmlValueOutOfRangeException: Date value is 
malformed: 2004-05-11 00:00:00.0".

What is wrong? Is there a way to parse this string (it is not possible 
to change the input XML file).

Many thanks,
Suraphol