Example usage for javax.xml.datatype XMLGregorianCalendar getTimeZone

List of usage examples for javax.xml.datatype XMLGregorianCalendar getTimeZone

Introduction

In this page you can find the example usage for javax.xml.datatype XMLGregorianCalendar getTimeZone.

Prototype

public abstract TimeZone getTimeZone(int defaultZoneoffset);

Source Link

Document

Returns a java.util.TimeZone for this class.

Usage

From source file:be.fedict.trust.xkms2.XKMSPortImpl.java

private Date getDate(XMLGregorianCalendar xmlCalendar) {

    GregorianCalendar calendar = new GregorianCalendar(xmlCalendar.getYear(), xmlCalendar.getMonth() - 1,
            xmlCalendar.getDay(), //
            xmlCalendar.getHour(), xmlCalendar.getMinute(), xmlCalendar.getSecond());
    calendar.setTimeZone(xmlCalendar.getTimeZone(0));
    return calendar.getTime();
}