Ranjit
Ranjit

Reputation: 144

what is the default millisecond value in XmlGregorianCalender?

I am reading value from the XML by unmarshalling,

Here is the format 04:09:20.90, return type of this is XMLGregorianCalender.

if i call XmlGregorianCalender.getMiliseccond() its returning 90,

but if there is no miliseconnd ex: 04:09:20 then what should be the value if i call XmlGregorianCalender.getMiliseccond()??

As per my understanding it should return 0 but here in my application its returning 52,

Ideas?

Upvotes: 1

Views: 195

Answers (1)

Teo
Teo

Reputation: 3213

As you can read into documentation:

The returned value is the rounded down to milliseconds value of getFractionalSecond(). When getFractionalSecond() returns null, this method must return DatatypeConstants.FIELD_UNDEFINED.

And getFractionalSecond() return null when the optional field is not defined.

Upvotes: 2

Related Questions