APISonar


java.time.chrono.IsoChronology.INSTANCE.date

> java > time > chrono > IsoChronology > INSTANCE > date
java APIs time APIs chrono APIs IsoChronology APIs INSTANCE APIs date APIs

Example 1
public void test_adjust_toMonth() {
        LocalDate isoDate = IsoChronology.INSTANCE.date(1726, 1, 4);
        assertEquals(IsoChronology.INSTANCE.date(1726, 4, 4), isoDate.with(Month.APRIL));
    }
Example 2
public void test_adjust1() {
        LocalDate base = IsoChronology.INSTANCE.date(1728, 10, 28);
        LocalDate test = base.with(TemporalAdjusters.lastDayOfMonth());
        assertEquals(test, IsoChronology.INSTANCE.date(1728, 10, 31));
    }
Example 3
public void test_createByProleptic_chronologyTemporalFactory(int y, int moy, int dom, int doy, LocalDate iso) {
        JapaneseDate test = JapaneseDate.of(y, moy, dom);
        assertEquals(IsoChronology.INSTANCE.date(test), iso);
        assertEquals(JapaneseChronology.INSTANCE.date(iso), test);
    }
Example 4
public void test_era_epochSecond_1(Era era, int y, int m, int d, int h , int min, int s, ZoneOffset offset) {
        assertEquals(IsoChronology.INSTANCE.epochSecond(era, y, m, d, h, min, s, offset),
                     OffsetDateTime.of(IsoChronology.INSTANCE.date(era, y, m, d), LocalTime.of(h, min, s), offset)
                                   .toEpochSecond());
    }
Example 5
public void test_LocalDateTime_adjustToISODate() {
        LocalDate isoDate = IsoChronology.INSTANCE.date(1728, 10, 29);
        LocalDateTime test = LocalDateTime.MIN.with(isoDate);
        assertEquals(test, LocalDateTime.of(1728, 10, 29, 0, 0));
    }
Example 6
public void test_date_withEra() {
        int year = 5;
        int month = 5;
        int dayOfMonth = 5;
        LocalDate test = IsoChronology.INSTANCE.date(IsoEra.BCE, year, month, dayOfMonth);
        assertEquals(test.getEra(), IsoEra.BCE);
        assertEquals(test.get(ChronoField.YEAR_OF_ERA), year);
        assertEquals(test.get(ChronoField.MONTH_OF_YEAR), month);
        assertEquals(test.get(ChronoField.DAY_OF_MONTH), dayOfMonth);

        assertEquals(test.get(YEAR), 1 + (-1 * year));
        assertEquals(test.get(ERA), 0);
        assertEquals(test.get(YEAR_OF_ERA), year);
    }