axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yu, Joel, Contractor" <Joel.Yu....@asamra.hoffman.army.mil>
Subject xsd:dateTime parse
Date Tue, 11 May 2004 19:27:03 GMT
The following is code generated by wsdl2java for xsd:dateTime type.  It is
unalbe to parse date of xsd:dateTime format.  I am getting a
java.text.ParseException.  I am using axis 1.1 and jdk 1.4.  How can I
change the following code so it will parse xsd:dateTime format.

thanks


    public DateTimeType(java.lang.String value) {
        java.util.Calendar cal = java.util.Calendar.getInstance();
        try {
          java.util.Date dt =
(java.text.DateFormat.getDateTimeInstance()).parse(value);  <-- throws
exception
          cal.setTime(dt);
          this.value = cal;
        }
        catch (java.text.ParseException e){
            throw new java.lang.RuntimeException(e.toString());
        }
    }

Mime
View raw message