Code example for XMLGregorianCalendar

Methods: add, clone, setTimezone

0
	 * <p>Implements W3C XML Schema Part 2, Section 3.2.7.3 (A).</p> 
	 */ 
	private XMLGregorianCalendar normalizeToTimezone(XMLGregorianCalendar cal, int timezone) {
 
	int minutes = timezone;    	
	XMLGregorianCalendar result = (XMLGregorianCalendar) cal.clone();
	 
	// normalizing to UTC time negates the timezone offset before  
	// addition. 
	minutes = -minutes;
	Duration d = new DurationImpl(minutes >= 0, // isPositive
				  0, //years 
				  0, //months 
				  0, //days 
				  0, //hours 
				  minutes < 0 ? -minutes : minutes, // absolute
				  0  //seconds 
				  ); 
	result.add(d);
 
	// set to zulu UTC time. 
	result.setTimezone(0);
	return result;
	} 
 
    /**  
     *