removing timezone from webservice dates (XMLGregorianCalendar) for date of birth etc.

If you have webservice that recieves a XMLGregorianCalendar as a parameter, if you try to obtain date from it, you might see a difference of 1 day due to timezone differences. (i.e., xmlDate.toGregorianCalendar().getTime()) . The solution is to eliminate the timeZone from xmldate using the following:

xmlDt.setTimezone( DatatypeConstants.FIELD_UNDEFINED )


More details on this here:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: