Package org.joda.time

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


      return dateTime.toString(formatter);
    }

    public void setFirstDayOfMonth() {
      MutableDateTime dateTime = new MutableDateTime(this.timeInMillis);
      dateTime.setDayOfMonth(dateTime.dayOfMonth().getMinimumValue());
      this.timeInMillis = dateTime.getMillis();
    }

    public void setLastDayOfMonth() {
      MutableDateTime dateTime = new MutableDateTime(this.timeInMillis);
View Full Code Here


      this.timeInMillis = dateTime.getMillis();
    }

    public void setLastDayOfMonth() {
      MutableDateTime dateTime = new MutableDateTime(this.timeInMillis);
      dateTime.setDayOfMonth(dateTime.dayOfMonth().getMaximumValue());
        this.timeInMillis = dateTime.getMillis();
    }
   
    public int getLastDayOfMonth() {
      return new DateTime(this.timeInMillis).dayOfMonth().getMaximumValue();
View Full Code Here

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

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

        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"));
    }

    @Test
    public void testRoundingSetOnTime() {
        MutableDateTime time = new MutableDateTime(DateTimeZone.UTC);
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.