Code example for Time

Methods: setJulianDay

0
        return jd;
    } 
 
    private YearAndMonth getYearAndMonthForPosition(int pos) {
        final int middle = getCenterPosition();
        mTime.setJulianDay(mCenterJulianDay);
 
        YearAndMonth ym = new YearAndMonth(mTime.year, mTime.month);
        if(pos != middle) {
            Calendar cal = Calendar.getInstance();
            cal.set(ym.year, ym.month, 1);
            cal.add(Calendar.MONTH, pos - middle);
 
            ym.month = cal.get(Calendar.MONTH);
            ym.year = cal.get(Calendar.YEAR);
        } 
 
        return ym;
    } 
 
    public static final int getMonthsDifference(Calendar first, Calendar second) {