Example usage for javax.xml.datatype XMLGregorianCalendar setMinute

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

Introduction

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

Prototype

public abstract void setMinute(int minute);

Source Link

Document

Set minutes.

Usage

From source file:org.techytax.util.DateHelper.java

public static XMLGregorianCalendar getDateForXml(Date date) {
    XMLGregorianCalendar calendar = null;
    try {//from ww w.  jav  a  2  s . com
        calendar = DatatypeFactory.newInstance().newXMLGregorianCalendar();
    } catch (DatatypeConfigurationException e) {
        e.printStackTrace();
    }
    calendar.setDay(getDay(date));
    calendar.setMonth(getMonth(date) + 1);
    calendar.setYear(getYear(date));
    calendar.setHour(0);
    calendar.setMinute(0);
    calendar.setSecond(0);
    return calendar;
}