Java Code Examples for org.joda.time.LocalTime#getMinuteOfHour()

The following examples show how to use org.joda.time.LocalTime#getMinuteOfHour() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TimestampColumnTimeOfDayMapper.java    From jadira with Apache License 2.0 5 votes vote down vote up
@Override
public TimeOfDay fromNonNullValue(Timestamp value) {

    DateTime dateTime = new DateTime(value.getTime());
    LocalTime localTime = dateTime.toLocalTime();

    final TimeOfDay timeOfDay = new TimeOfDay(localTime.getHourOfDay(), localTime.getMinuteOfHour(), localTime.getSecondOfMinute(), localTime.getMillisOfSecond(), localTime.getChronology());
    return timeOfDay;
}
 
Example 2
Source File: TimeColumnTimeOfDayMapper.java    From jadira with Apache License 2.0 5 votes vote down vote up
@Override
public TimeOfDay fromNonNullValue(Time value) {

    DateTime dateTime = new DateTime(value.getTime());
    LocalTime localTime = dateTime.toLocalTime();

    final TimeOfDay timeOfDay = new TimeOfDay(localTime.getHourOfDay(), localTime.getMinuteOfHour(), localTime.getSecondOfMinute(), localTime.getMillisOfSecond(), localTime.getChronology());
    return timeOfDay;
}
 
Example 3
Source File: HourMinuteSecond.java    From fenixedu-academic with GNU Lesser General Public License v3.0 2 votes vote down vote up
/**
 * Constructs a HourMinuteSecond from a LocalTime, using exactly the same
 * fields, but ignoring the millis.
 * 
 * @return the created HourMinuteSecond
 */
public static HourMinuteSecond fromLocalTime(LocalTime time) {
    return new HourMinuteSecond(time.getHourOfDay(), time.getMinuteOfHour(), time.getSecondOfMinute());
}