Examples of year()


Examples of org.joda.time.DateTime.year()

    }

    public void testLeap_5_13() {
        Chronology chrono = CopticChronology.getInstance();
        DateTime dt = new DateTime(3, 13, 5, 0, 0, chrono);
        assertEquals(true, dt.year().isLeap());
        assertEquals(true, dt.monthOfYear().isLeap());
        assertEquals(false, dt.dayOfMonth().isLeap());
        assertEquals(false, dt.dayOfYear().isLeap());
    }
View Full Code Here

Examples of org.joda.time.DateTime.year()

    }

    public void testLeap_6_13() {
        Chronology chrono = CopticChronology.getInstance();
        DateTime dt = new DateTime(3, 13, 6, 0, 0, chrono);
        assertEquals(true, dt.year().isLeap());
        assertEquals(true, dt.monthOfYear().isLeap());
        assertEquals(true, dt.dayOfMonth().isLeap());
        assertEquals(true, dt.dayOfYear().isLeap());
    }
View Full Code Here

Examples of org.joda.time.DateTime.year()

//        }
        DateTime dt = new DateTime(GJChronology.getInstance());
        for (int i = 0; i < AVERAGE; i++) {
            start("Joda", "setGetYear");
            for (int j = 0; j < COUNT; j++) {
                dt = dt.year().setCopy(1972);
                int val = dt.getYear();
                if (val < 0) {System.out.println("Anti optimise");}
            }
            end(COUNT);
        }
View Full Code Here

Examples of org.joda.time.DateTime.year()

//        }
        DateTime dt = new DateTime();
        for (int i = 0; i < AVERAGE; i++) {
            start("JISO", "setGetYear");
            for (int j = 0; j < COUNT; j++) {
                dt = dt.year().setCopy(1972);
                int val = dt.getYear();
                if (val < 0) {System.out.println("Anti optimise");}
            }
            end(COUNT);
        }
View Full Code Here

Examples of org.joda.time.LocalDate.year()

        .dataInicial(dataInicial).dataDeCriacao(dataDeCriacao).novaInstancia();
  }

  private void assertAno(Registro registro, int ano) {
    LocalDate dataInicial = registro.getDataInicial();
    assertEquals(dataInicial.year().get(), ano);
  }

  private void assertAnoDeCriacao(Registro registro, int ano) {
    LocalDate dataDeCriacao = registro.getDataDeCriacao().toLocalDate();
    assertEquals(dataDeCriacao.year().get(), ano);
View Full Code Here

Examples of org.joda.time.YearMonthDay.year()

    public void testMaximumValue() {
        DateMidnight dt = new DateMidnight(1570, 1, 1, GJChronology.getInstance());
        while (dt.getYear() < 1590) {
            dt = dt.plusDays(1);
            YearMonthDay ymd = dt.toYearMonthDay();
            assertEquals(dt.year().getMaximumValue(), ymd.year().getMaximumValue());
            assertEquals(dt.monthOfYear().getMaximumValue(), ymd.monthOfYear().getMaximumValue());
            assertEquals(dt.dayOfMonth().getMaximumValue(), ymd.dayOfMonth().getMaximumValue());
        }
    }
View Full Code Here

Examples of org.joda.time.YearMonthDay.year()

    public void testMaximumValue() {
        DateMidnight dt = new DateMidnight(1570, 1, 1);
        while (dt.getYear() < 1590) {
            dt = dt.plusDays(1);
            YearMonthDay ymd = dt.toYearMonthDay();
            assertEquals(dt.year().getMaximumValue(), ymd.year().getMaximumValue());
            assertEquals(dt.monthOfYear().getMaximumValue(), ymd.monthOfYear().getMaximumValue());
            assertEquals(dt.dayOfMonth().getMaximumValue(), ymd.dayOfMonth().getMaximumValue());
        }
    }
View Full Code Here

Examples of org.jquantlib.time.Date.year()

        final Date referenceDate = baseCurve.referenceDate();
        if (jumpDates_.length==0 && jumps.length!=0) { // turn of year dates
            this.jumpDates_ = new Date[nJumps];
            this.jumpTimes = new double[nJumps];
            for (int i=0; i<nJumps; ++i) {
                jumpDates_[i] = new Date(31, Month.December, referenceDate.year()+i);
            }
        } else { // fixed dats
            QL.require(jumpDates_.length==nJumps, "mismatch between number of jumps and jump dates");
        }
        for (int i=0; i<nJumps; ++i) {
View Full Code Here

Examples of org.jquantlib.time.Date.year()

    @Test
    public void isoDates() {
        QL.info("Testing ISO dates...");
        final String input_date = "2006-01-15";
        final Date d = DateParser.parseISO(input_date);
        if ((d.dayOfMonth() != 15) || (d.month() != Month.January) || (d.year() != 2006)) {
            fail("Iso date failed\n"
                    + " input date:    " + input_date + "\n"
                    + " day of month:  " + d.dayOfMonth() + "\n"
                    + " month:         " + d.month() + "\n"
                    + " year:          " + d.year());
View Full Code Here

Examples of org.jquantlib.time.Date.year()

        if ((d.dayOfMonth() != 15) || (d.month() != Month.January) || (d.year() != 2006)) {
            fail("Iso date failed\n"
                    + " input date:    " + input_date + "\n"
                    + " day of month:  " + d.dayOfMonth() + "\n"
                    + " month:         " + d.month() + "\n"
                    + " year:          " + d.year());
        }
    }

    @Test
    public void testLowerUpperBound() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.