Example usage for org.joda.time.base BaseDateTime getDayOfYear

List of usage examples for org.joda.time.base BaseDateTime getDayOfYear

Introduction

In this page you can find the example usage for org.joda.time.base BaseDateTime getDayOfYear.

Prototype

public int getDayOfYear() 

Source Link

Document

Get the day of year field value.

Usage

From source file:de.pezeshki.bahaiCalendarLibrary.BadiDate.java

License:Apache License

/**
 * Creates a BadiDate from Joda DateTime.
 *
 * @param Joda//from   w w  w.ja  v a  2 s.c o m
 *            DateTime
 * @return The Badi date
 * @throws IllegalArgumentException
 *             Year is less than 1844 or greater than UPPER_YEAR_LIMIT
 */
public static BadiDate createFromDateTime(final BaseDateTime gregorianDate) throws IllegalArgumentException {
    final int year = gregorianDate.getYear();
    try {
        checkGregorianYearForValidity(year);
    } catch (final IllegalArgumentException e) {
        throw new IllegalArgumentException(e);
    }
    final int doy = gregorianDate.getDayOfYear();
    return createFromGregorianDoyAndYear(year, doy);
}