Example usage for java.util GregorianCalendar setGregorianChange

List of usage examples for java.util GregorianCalendar setGregorianChange

Introduction

In this page you can find the example usage for java.util GregorianCalendar setGregorianChange.

Prototype

private void setGregorianChange(long cutoverTime) 

Source Link

Usage

From source file:Main.java

public static void main(String[] args) {

    GregorianCalendar cal = (GregorianCalendar) GregorianCalendar.getInstance();

    // set gregorian change at another date
    cal.setGregorianChange(new Date());
    System.out.println("Gregorian Change Date" + cal.getGregorianChange());

}

From source file:Main.java

private static Date calculate(Date d, int field, int amount) {
    if (d == null)
        return null;
    GregorianCalendar g = new GregorianCalendar();
    g.setGregorianChange(d);
    g.add(field, amount);/*from   w  w  w  .  j a  v  a 2  s .com*/
    return g.getTime();
}

From source file:org.openanzo.rdf.datatype.TypeMaps.java

/**
 * Create an XML Calendar for the time in millis
 * //ww  w . j a  v a2 s.  c o  m
 * @param millis
 * @return XML Calendar
 */
public static XMLGregorianCalendar getXMLCaledar(long millis) {
    GregorianCalendar cal = new GregorianCalendar(DateUtils.UTC_TIME_ZONE);
    cal.clear();
    cal.setGregorianChange(MIN_DATE);
    cal.setTimeInMillis(millis);
    return TypeMaps.datatypeFactory.newXMLGregorianCalendar(cal);
}

From source file:org.openanzo.rdf.datatype.TypeMaps.java

/**
 * Create an XML Calendar for the time in millis
 * //from   w ww.  ja v  a 2s. co  m
 * @param millis
 * @return XML Calendar
 */
public static XMLGregorianCalendar getXMLCaledar(Date date) {
    GregorianCalendar cal = new GregorianCalendar(DateUtils.UTC_TIME_ZONE);
    cal.clear();
    cal.setGregorianChange(MIN_DATE);
    cal.setTime(date);
    return TypeMaps.datatypeFactory.newXMLGregorianCalendar(cal);
}