Example usage for org.joda.time.chrono JulianChronology getInstanceUTC

List of usage examples for org.joda.time.chrono JulianChronology getInstanceUTC

Introduction

In this page you can find the example usage for org.joda.time.chrono JulianChronology getInstanceUTC.

Prototype

public static JulianChronology getInstanceUTC() 

Source Link

Document

Gets an instance of the JulianChronology.

Usage

From source file:com.jjlharrison.jollyday.util.CalendarUtil.java

License:Apache License

/**
 * Returns the easter sunday within the julian chronology.
 *
 * @param year/* w  w w.ja  va 2s .  c  o m*/
 *            a int.
 * @return julian easter sunday
 */
public LocalDate getJulianEasterSunday(int year) {
    int a, b, c, d, e;
    int x, month, day;
    a = year % 4;
    b = year % 7;
    c = year % 19;
    d = (19 * c + 15) % 30;
    e = (2 * a + 4 * b - d + 34) % 7;
    x = d + e + 114;
    month = x / 31;
    day = (x % 31) + 1;
    LocalDate julianEasterDate = create(year, (month == 3 ? DateTimeConstants.MARCH : DateTimeConstants.APRIL),
            day, JulianChronology.getInstanceUTC());
    return convertToISODate(julianEasterDate);
}