Examples of dayOfMonth()


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

        //Get the weekday
        final Weekday weekDayOfThisDate = today.weekday();
        System.out.println("The weekday of this date is = "+weekDayOfThisDate);

        //Get the day of the date for it's month
        System.out.println("The day of the date as a day in this date's month(1-31) is = "+today.dayOfMonth());

        //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
View Full Code Here

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

        final Date fourthWeekdayDate = Date.nthWeekday(4, Weekday.Tuesday, today.month(), today.year());
        System.out.println("The fourthWeekdayDate which is TUESDAY is = "+fourthWeekdayDate);

        //Let's try getting the first date of the month to which today's date belong to
        final Date dateEndOfMonth = Date.endOfMonth(today);
        final int dayOfEndOfMonth = dateEndOfMonth.dayOfMonth();
        final Date dateStartOfMonth = dateEndOfMonth.add(-dayOfEndOfMonth+1);
        System.out.println("The first date of the month to which todays date belong to is = "+dateStartOfMonth);

        //Let's try getting the first date of the month to which today's date belong to using Period
        final Period period = new Period(-today.dayOfMonth()+1,TimeUnit.Days);
View Full Code Here

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

    @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.dayOfMonth()

        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.dayOfMonth()

          // 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) {
                QL.info(String.format("JQL Date = %s   :::   ISODate = %s", jqlDate.toString(), javaDate.toString()));
            }
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.