Examples of year()


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

            Date newD2 = dateEnd;
            Date temp = dateEnd;
            double sum = 0.0;
            while (temp.gt(dateStart)) {
                temp = newD2.add(Period.ONE_YEAR_BACKWARD);
                if (temp.dayOfMonth() == 28 && temp.month().value() == 2 && Date.isLeap(temp.year()))
                    temp.inc();
                if (temp.ge(dateStart)) {
                    sum += 1.0;
                    newD2 = temp;
                }
View Full Code Here

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

        final Date referenceDate = baseCurve.referenceDate();
        if (this.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<jumps.length; ++i) {
                jumpDates[i] = new Date(31, Month.December, referenceDate.year()+i);
            }
        } else { // fixed dates
            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()

            Date newD2 = dateEnd;
            Date temp = dateEnd;
            double sum = 0.0;
            while (temp.gt(dateStart)) {
                temp = newD2.add(Period.ONE_YEAR_BACKWARD);
                if (temp.dayOfMonth() == 28 && temp.month().value() == 2 && Date.isLeap(temp.year()))
                    temp.inc();
                if (temp.ge(dateStart)) {
                    sum += 1.0;
                    newD2 = temp;
                }
View Full Code Here

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

        //Get the day of the date for it's year
        System.out.println("The day of the date as day in it's year(1-366) is = "+today.dayOfYear());

        //Check if the date belongs to a leap year
        if (Date.isLeap(today.year())) {
            System.out.println("Today's date belong to leap year");
        }

        //Get the next nextWeekdayDate of this date's month having weekday as TUESDAY
        final Date nextWeekdayDate = Date.nextWeekday(today,Weekday.Tuesday);
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 testConvertionToJavaDate() {
View Full Code Here

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

          // obtain a JQL Date from a Java Date
          jqlDate = new Date(javaDate);

          // compare d,m,y
            boolean test = true;
            test &= ( jqlDate.year()          == jyear );
            test &= ( jqlDate.month().value() == jmonth + 1); //Java month is 0-11
            test &= ( jqlDate.dayOfMonth()    == jday );
            success &= test;

            if (!test) {
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.