Package org.joda.time

Examples of org.joda.time.MutableDateTime.monthOfYear()


                        }
                        break;
                    case 'M':
                        if (type == 0) {
                            if (roundUp) {
                                dateTime.monthOfYear().roundCeiling();
                            } else {
                                dateTime.monthOfYear().roundFloor();
                            }
                        } else if (type == 1) {
                            dateTime.addMonths(num);
View Full Code Here


                    case 'M':
                        if (type == 0) {
                            if (roundUp) {
                                dateTime.monthOfYear().roundCeiling();
                            } else {
                                dateTime.monthOfYear().roundFloor();
                            }
                        } else if (type == 1) {
                            dateTime.addMonths(num);
                        } else if (type == 2) {
                            dateTime.addMonths(-num);
View Full Code Here

    @Test
    public void testRounding() {
        long TIME = utcTimeInMillis("2009-02-03T01:01:01");
        MutableDateTime time = new MutableDateTime(DateTimeZone.UTC);
        time.setMillis(TIME);
        assertThat(time.monthOfYear().roundFloor().toString(), equalTo("2009-02-01T00:00:00.000Z"));
        time.setMillis(TIME);
        assertThat(time.hourOfDay().roundFloor().toString(), equalTo("2009-02-03T01:00:00.000Z"));
        time.setMillis(TIME);
        assertThat(time.dayOfMonth().roundFloor().toString(), equalTo("2009-02-03T00:00:00.000Z"));
    }
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.