Java Code Examples for sun.util.calendar.BaseCalendar#getCalendarDateFromFixedDate()

The following examples show how to use sun.util.calendar.BaseCalendar#getCalendarDateFromFixedDate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GregorianCalendar.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void setGregorianChange(long cutoverTime) {
    gregorianCutover = cutoverTime;
    gregorianCutoverDate = CalendarUtils.floorDivide(cutoverTime, ONE_DAY)
                            + EPOCH_OFFSET;

    // To provide the "pure" Julian calendar as advertised.
    // Strictly speaking, the last millisecond should be a
    // Gregorian date. However, the API doc specifies that setting
    // the cutover date to Long.MAX_VALUE will make this calendar
    // a pure Julian calendar. (See 4167995)
    if (cutoverTime == Long.MAX_VALUE) {
        gregorianCutoverDate++;
    }

    BaseCalendar.Date d = getGregorianCutoverDate();

    // Set the cutover year (in the Gregorian year numbering)
    gregorianCutoverYear = d.getYear();

    BaseCalendar julianCal = getJulianCalendarSystem();
    d = (BaseCalendar.Date) julianCal.newCalendarDate(TimeZone.NO_TIMEZONE);
    julianCal.getCalendarDateFromFixedDate(d, gregorianCutoverDate - 1);
    gregorianCutoverYearJulian = d.getNormalizedYear();

    if (time < gregorianCutover) {
        // The field values are no longer valid under the new
        // cutover date.
        setUnnormalized();
    }
}
 
Example 2
Source File: GregorianCalendar.java    From jdk-1.7-annotated with Apache License 2.0 5 votes vote down vote up
/**
 * Returns a CalendarDate produced from the specified fixed date.
 *
 * @param fd the fixed date
 */
private final BaseCalendar.Date getCalendarDate(long fd) {
    BaseCalendar cal = (fd >= gregorianCutoverDate) ? gcal : getJulianCalendarSystem();
    BaseCalendar.Date d = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.NO_TIMEZONE);
    cal.getCalendarDateFromFixedDate(d, fd);
    return d;
}
 
Example 3
Source File: GregorianCalendar.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void setGregorianChange(long cutoverTime) {
    gregorianCutover = cutoverTime;
    gregorianCutoverDate = CalendarUtils.floorDivide(cutoverTime, ONE_DAY)
                            + EPOCH_OFFSET;

    // To provide the "pure" Julian calendar as advertised.
    // Strictly speaking, the last millisecond should be a
    // Gregorian date. However, the API doc specifies that setting
    // the cutover date to Long.MAX_VALUE will make this calendar
    // a pure Julian calendar. (See 4167995)
    if (cutoverTime == Long.MAX_VALUE) {
        gregorianCutoverDate++;
    }

    BaseCalendar.Date d = getGregorianCutoverDate();

    // Set the cutover year (in the Gregorian year numbering)
    gregorianCutoverYear = d.getYear();

    BaseCalendar julianCal = getJulianCalendarSystem();
    d = (BaseCalendar.Date) julianCal.newCalendarDate(TimeZone.NO_TIMEZONE);
    julianCal.getCalendarDateFromFixedDate(d, gregorianCutoverDate - 1);
    gregorianCutoverYearJulian = d.getNormalizedYear();

    if (time < gregorianCutover) {
        // The field values are no longer valid under the new
        // cutover date.
        setUnnormalized();
    }
}
 
Example 4
Source File: GregorianCalendar.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a CalendarDate produced from the specified fixed date.
 *
 * @param fd the fixed date
 */
private BaseCalendar.Date getCalendarDate(long fd) {
    BaseCalendar cal = (fd >= gregorianCutoverDate) ? gcal : getJulianCalendarSystem();
    BaseCalendar.Date d = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.NO_TIMEZONE);
    cal.getCalendarDateFromFixedDate(d, fd);
    return d;
}
 
Example 5
Source File: GregorianCalendar.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a CalendarDate produced from the specified fixed date.
 *
 * @param fd the fixed date
 */
private BaseCalendar.Date getCalendarDate(long fd) {
    BaseCalendar cal = (fd >= gregorianCutoverDate) ? gcal : getJulianCalendarSystem();
    BaseCalendar.Date d = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.NO_TIMEZONE);
    cal.getCalendarDateFromFixedDate(d, fd);
    return d;
}
 
Example 6
Source File: GregorianCalendar.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Returns a CalendarDate produced from the specified fixed date.
 *
 * @param fd the fixed date
 */
private BaseCalendar.Date getCalendarDate(long fd) {
    BaseCalendar cal = (fd >= gregorianCutoverDate) ? gcal : getJulianCalendarSystem();
    BaseCalendar.Date d = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.NO_TIMEZONE);
    cal.getCalendarDateFromFixedDate(d, fd);
    return d;
}
 
Example 7
Source File: GregorianCalendar.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private void setGregorianChange(long cutoverTime) {
    gregorianCutover = cutoverTime;
    gregorianCutoverDate = CalendarUtils.floorDivide(cutoverTime, ONE_DAY)
                            + EPOCH_OFFSET;

    // To provide the "pure" Julian calendar as advertised.
    // Strictly speaking, the last millisecond should be a
    // Gregorian date. However, the API doc specifies that setting
    // the cutover date to Long.MAX_VALUE will make this calendar
    // a pure Julian calendar. (See 4167995)
    if (cutoverTime == Long.MAX_VALUE) {
        gregorianCutoverDate++;
    }

    BaseCalendar.Date d = getGregorianCutoverDate();

    // Set the cutover year (in the Gregorian year numbering)
    gregorianCutoverYear = d.getYear();

    BaseCalendar julianCal = getJulianCalendarSystem();
    d = (BaseCalendar.Date) julianCal.newCalendarDate(TimeZone.NO_TIMEZONE);
    julianCal.getCalendarDateFromFixedDate(d, gregorianCutoverDate - 1);
    gregorianCutoverYearJulian = d.getNormalizedYear();

    if (time < gregorianCutover) {
        // The field values are no longer valid under the new
        // cutover date.
        setUnnormalized();
    }
}
 
Example 8
Source File: GregorianCalendar.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a CalendarDate produced from the specified fixed date.
 *
 * @param fd the fixed date
 */
private BaseCalendar.Date getCalendarDate(long fd) {
    BaseCalendar cal = (fd >= gregorianCutoverDate) ? gcal : getJulianCalendarSystem();
    BaseCalendar.Date d = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.NO_TIMEZONE);
    cal.getCalendarDateFromFixedDate(d, fd);
    return d;
}
 
Example 9
Source File: GregorianCalendar.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void setGregorianChange(long cutoverTime) {
    gregorianCutover = cutoverTime;
    gregorianCutoverDate = CalendarUtils.floorDivide(cutoverTime, ONE_DAY)
                            + EPOCH_OFFSET;

    // To provide the "pure" Julian calendar as advertised.
    // Strictly speaking, the last millisecond should be a
    // Gregorian date. However, the API doc specifies that setting
    // the cutover date to Long.MAX_VALUE will make this calendar
    // a pure Julian calendar. (See 4167995)
    if (cutoverTime == Long.MAX_VALUE) {
        gregorianCutoverDate++;
    }

    BaseCalendar.Date d = getGregorianCutoverDate();

    // Set the cutover year (in the Gregorian year numbering)
    gregorianCutoverYear = d.getYear();

    BaseCalendar julianCal = getJulianCalendarSystem();
    d = (BaseCalendar.Date) julianCal.newCalendarDate(TimeZone.NO_TIMEZONE);
    julianCal.getCalendarDateFromFixedDate(d, gregorianCutoverDate - 1);
    gregorianCutoverYearJulian = d.getNormalizedYear();

    if (time < gregorianCutover) {
        // The field values are no longer valid under the new
        // cutover date.
        setUnnormalized();
    }
}
 
Example 10
Source File: GregorianCalendar.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a CalendarDate produced from the specified fixed date.
 *
 * @param fd the fixed date
 */
private BaseCalendar.Date getCalendarDate(long fd) {
    BaseCalendar cal = (fd >= gregorianCutoverDate) ? gcal : getJulianCalendarSystem();
    BaseCalendar.Date d = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.NO_TIMEZONE);
    cal.getCalendarDateFromFixedDate(d, fd);
    return d;
}
 
Example 11
Source File: GregorianCalendar.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
private void setGregorianChange(long cutoverTime) {
    gregorianCutover = cutoverTime;
    gregorianCutoverDate = CalendarUtils.floorDivide(cutoverTime, ONE_DAY)
                            + EPOCH_OFFSET;

    // To provide the "pure" Julian calendar as advertised.
    // Strictly speaking, the last millisecond should be a
    // Gregorian date. However, the API doc specifies that setting
    // the cutover date to Long.MAX_VALUE will make this calendar
    // a pure Julian calendar. (See 4167995)
    if (cutoverTime == Long.MAX_VALUE) {
        gregorianCutoverDate++;
    }

    BaseCalendar.Date d = getGregorianCutoverDate();

    // Set the cutover year (in the Gregorian year numbering)
    gregorianCutoverYear = d.getYear();

    BaseCalendar julianCal = getJulianCalendarSystem();
    d = (BaseCalendar.Date) julianCal.newCalendarDate(TimeZone.NO_TIMEZONE);
    julianCal.getCalendarDateFromFixedDate(d, gregorianCutoverDate - 1);
    gregorianCutoverYearJulian = d.getNormalizedYear();

    if (time < gregorianCutover) {
        // The field values are no longer valid under the new
        // cutover date.
        setUnnormalized();
    }
}
 
Example 12
Source File: GregorianCalendar.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Returns a CalendarDate produced from the specified fixed date.
 *
 * @param fd the fixed date
 */
private BaseCalendar.Date getCalendarDate(long fd) {
    BaseCalendar cal = (fd >= gregorianCutoverDate) ? gcal : getJulianCalendarSystem();
    BaseCalendar.Date d = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.NO_TIMEZONE);
    cal.getCalendarDateFromFixedDate(d, fd);
    return d;
}
 
Example 13
Source File: GregorianCalendar.java    From j2objc with Apache License 2.0 5 votes vote down vote up
private void setGregorianChange(long cutoverTime) {
    gregorianCutover = cutoverTime;
    gregorianCutoverDate = CalendarUtils.floorDivide(cutoverTime, ONE_DAY)
                            + EPOCH_OFFSET;

    // To provide the "pure" Julian calendar as advertised.
    // Strictly speaking, the last millisecond should be a
    // Gregorian date. However, the API doc specifies that setting
    // the cutover date to Long.MAX_VALUE will make this calendar
    // a pure Julian calendar. (See 4167995)
    if (cutoverTime == Long.MAX_VALUE) {
        gregorianCutoverDate++;
    }

    BaseCalendar.Date d = getGregorianCutoverDate();

    // Set the cutover year (in the Gregorian year numbering)
    gregorianCutoverYear = d.getYear();

    BaseCalendar julianCal = getJulianCalendarSystem();
    d = (BaseCalendar.Date) julianCal.newCalendarDate(TimeZone.NO_TIMEZONE);
    julianCal.getCalendarDateFromFixedDate(d, gregorianCutoverDate - 1);
    gregorianCutoverYearJulian = d.getNormalizedYear();

    if (time < gregorianCutover) {
        // The field values are no longer valid under the new
        // cutover date.
        setUnnormalized();
    }
}
 
Example 14
Source File: GregorianCalendar.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a CalendarDate produced from the specified fixed date.
 *
 * @param fd the fixed date
 */
private BaseCalendar.Date getCalendarDate(long fd) {
    BaseCalendar cal = (fd >= gregorianCutoverDate) ? gcal : getJulianCalendarSystem();
    BaseCalendar.Date d = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.NO_TIMEZONE);
    cal.getCalendarDateFromFixedDate(d, fd);
    return d;
}
 
Example 15
Source File: GregorianCalendar.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void setGregorianChange(long cutoverTime) {
    gregorianCutover = cutoverTime;
    gregorianCutoverDate = CalendarUtils.floorDivide(cutoverTime, ONE_DAY)
                            + EPOCH_OFFSET;

    // To provide the "pure" Julian calendar as advertised.
    // Strictly speaking, the last millisecond should be a
    // Gregorian date. However, the API doc specifies that setting
    // the cutover date to Long.MAX_VALUE will make this calendar
    // a pure Julian calendar. (See 4167995)
    if (cutoverTime == Long.MAX_VALUE) {
        gregorianCutoverDate++;
    }

    BaseCalendar.Date d = getGregorianCutoverDate();

    // Set the cutover year (in the Gregorian year numbering)
    gregorianCutoverYear = d.getYear();

    BaseCalendar julianCal = getJulianCalendarSystem();
    d = (BaseCalendar.Date) julianCal.newCalendarDate(TimeZone.NO_TIMEZONE);
    julianCal.getCalendarDateFromFixedDate(d, gregorianCutoverDate - 1);
    gregorianCutoverYearJulian = d.getNormalizedYear();

    if (time < gregorianCutover) {
        // The field values are no longer valid under the new
        // cutover date.
        setUnnormalized();
    }
}
 
Example 16
Source File: GregorianCalendar.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void setGregorianChange(long cutoverTime) {
    gregorianCutover = cutoverTime;
    gregorianCutoverDate = CalendarUtils.floorDivide(cutoverTime, ONE_DAY)
                            + EPOCH_OFFSET;

    // To provide the "pure" Julian calendar as advertised.
    // Strictly speaking, the last millisecond should be a
    // Gregorian date. However, the API doc specifies that setting
    // the cutover date to Long.MAX_VALUE will make this calendar
    // a pure Julian calendar. (See 4167995)
    if (cutoverTime == Long.MAX_VALUE) {
        gregorianCutoverDate++;
    }

    BaseCalendar.Date d = getGregorianCutoverDate();

    // Set the cutover year (in the Gregorian year numbering)
    gregorianCutoverYear = d.getYear();

    BaseCalendar julianCal = getJulianCalendarSystem();
    d = (BaseCalendar.Date) julianCal.newCalendarDate(TimeZone.NO_TIMEZONE);
    julianCal.getCalendarDateFromFixedDate(d, gregorianCutoverDate - 1);
    gregorianCutoverYearJulian = d.getNormalizedYear();

    if (time < gregorianCutover) {
        // The field values are no longer valid under the new
        // cutover date.
        setUnnormalized();
    }
}
 
Example 17
Source File: GregorianCalendar.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
/**
 * Returns a CalendarDate produced from the specified fixed date.
 *
 * @param fd the fixed date
 */
private BaseCalendar.Date getCalendarDate(long fd) {
    BaseCalendar cal = (fd >= gregorianCutoverDate) ? gcal : getJulianCalendarSystem();
    BaseCalendar.Date d = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.NO_TIMEZONE);
    cal.getCalendarDateFromFixedDate(d, fd);
    return d;
}
 
Example 18
Source File: GregorianCalendar.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
private void setGregorianChange(long cutoverTime) {
    gregorianCutover = cutoverTime;
    gregorianCutoverDate = CalendarUtils.floorDivide(cutoverTime, ONE_DAY)
                            + EPOCH_OFFSET;

    // To provide the "pure" Julian calendar as advertised.
    // Strictly speaking, the last millisecond should be a
    // Gregorian date. However, the API doc specifies that setting
    // the cutover date to Long.MAX_VALUE will make this calendar
    // a pure Julian calendar. (See 4167995)
    if (cutoverTime == Long.MAX_VALUE) {
        gregorianCutoverDate++;
    }

    BaseCalendar.Date d = getGregorianCutoverDate();

    // Set the cutover year (in the Gregorian year numbering)
    gregorianCutoverYear = d.getYear();

    BaseCalendar julianCal = getJulianCalendarSystem();
    d = (BaseCalendar.Date) julianCal.newCalendarDate(TimeZone.NO_TIMEZONE);
    julianCal.getCalendarDateFromFixedDate(d, gregorianCutoverDate - 1);
    gregorianCutoverYearJulian = d.getNormalizedYear();

    if (time < gregorianCutover) {
        // The field values are no longer valid under the new
        // cutover date.
        setUnnormalized();
    }
}
 
Example 19
Source File: GregorianCalendar.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void setGregorianChange(long cutoverTime) {
    gregorianCutover = cutoverTime;
    gregorianCutoverDate = CalendarUtils.floorDivide(cutoverTime, ONE_DAY)
                            + EPOCH_OFFSET;

    // To provide the "pure" Julian calendar as advertised.
    // Strictly speaking, the last millisecond should be a
    // Gregorian date. However, the API doc specifies that setting
    // the cutover date to Long.MAX_VALUE will make this calendar
    // a pure Julian calendar. (See 4167995)
    if (cutoverTime == Long.MAX_VALUE) {
        gregorianCutoverDate++;
    }

    BaseCalendar.Date d = getGregorianCutoverDate();

    // Set the cutover year (in the Gregorian year numbering)
    gregorianCutoverYear = d.getYear();

    BaseCalendar julianCal = getJulianCalendarSystem();
    d = (BaseCalendar.Date) julianCal.newCalendarDate(TimeZone.NO_TIMEZONE);
    julianCal.getCalendarDateFromFixedDate(d, gregorianCutoverDate - 1);
    gregorianCutoverYearJulian = d.getNormalizedYear();

    if (time < gregorianCutover) {
        // The field values are no longer valid under the new
        // cutover date.
        setUnnormalized();
    }
}
 
Example 20
Source File: GregorianCalendar.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void setGregorianChange(long cutoverTime) {
    gregorianCutover = cutoverTime;
    gregorianCutoverDate = CalendarUtils.floorDivide(cutoverTime, ONE_DAY)
                            + EPOCH_OFFSET;

    // To provide the "pure" Julian calendar as advertised.
    // Strictly speaking, the last millisecond should be a
    // Gregorian date. However, the API doc specifies that setting
    // the cutover date to Long.MAX_VALUE will make this calendar
    // a pure Julian calendar. (See 4167995)
    if (cutoverTime == Long.MAX_VALUE) {
        gregorianCutoverDate++;
    }

    BaseCalendar.Date d = getGregorianCutoverDate();

    // Set the cutover year (in the Gregorian year numbering)
    gregorianCutoverYear = d.getYear();

    BaseCalendar julianCal = getJulianCalendarSystem();
    d = (BaseCalendar.Date) julianCal.newCalendarDate(TimeZone.NO_TIMEZONE);
    julianCal.getCalendarDateFromFixedDate(d, gregorianCutoverDate - 1);
    gregorianCutoverYearJulian = d.getNormalizedYear();

    if (time < gregorianCutover) {
        // The field values are no longer valid under the new
        // cutover date.
        setUnnormalized();
    }
}