Example usage for org.joda.time TimeOfDay TimeOfDay

List of usage examples for org.joda.time TimeOfDay TimeOfDay

Introduction

In this page you can find the example usage for org.joda.time TimeOfDay TimeOfDay.

Prototype

public TimeOfDay(int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond,
        Chronology chronology) 

Source Link

Document

Constructs a TimeOfDay with specified time field values and chronology.

Usage

From source file:org.jadira.usertype.dateandtime.joda.columnmapper.TimeColumnTimeOfDayMapper.java

License:Apache License

@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;
}

From source file:org.jadira.usertype.dateandtime.joda.columnmapper.TimestampColumnTimeOfDayMapper.java

License:Apache License

@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;
}