List of usage examples for org.joda.time DateTimeConstants MINUTES_PER_HOUR
int MINUTES_PER_HOUR
To view the source code for org.joda.time DateTimeConstants MINUTES_PER_HOUR.
Click Source Link
From source file:com.alliander.osgp.acceptancetests.deviceinstallation.RegisterDeviceSteps.java
License:Open Source License
@DomainStep("the register response should contain timezone of platform") public boolean thenTheRegisterDeviceResponseShouldContainTimezoneOfPlatform() { LOGGER.info("THEN: \"the register response should contain timezone of platform\"."); Assert.assertTrue(this.response.hasLocationInfo()); final LocationInfo location = this.response.getLocationInfo(); // Offset should be +1 hour Assert.assertEquals(1 * DateTimeConstants.MINUTES_PER_HOUR, location.getTimeOffset()); return true;/*from www . j av a 2 s .c o m*/ }
From source file:net.sourceforge.fenixedu.domain.teacher.DegreeTeachingService.java
License:Open Source License
public double getTotalHoursAfter20AndSaturdays() { int minutesAfter20AndSaturday = 0; for (Lesson lesson : getShift().getAssociatedLessonsSet()) { for (Interval lessonInterval : lesson.getAllLessonIntervals()) { if (lessonInterval.getStart().getDayOfWeek() == DateTimeConstants.SATURDAY) { minutesAfter20AndSaturday += Minutes .minutesBetween(lessonInterval.getStart(), lessonInterval.getEnd()).getMinutes(); } else { DateTime dateTimeAfter20 = lessonInterval.getStart().toLocalDate() .toDateTime(new LocalTime(20, 0, 0)); if (dateTimeAfter20.isBefore(lessonInterval.getEnd())) { if (!dateTimeAfter20.isAfter(lessonInterval.getStart())) { minutesAfter20AndSaturday += Minutes .minutesBetween(lessonInterval.getStart(), lessonInterval.getEnd()) .getMinutes(); } else { minutesAfter20AndSaturday += Minutes .minutesBetween(dateTimeAfter20, lessonInterval.getEnd()).getMinutes(); }/*from ww w . ja va 2 s. co m*/ } } } } return (double) minutesAfter20AndSaturday / DateTimeConstants.MINUTES_PER_HOUR; }