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

TimeOfDay(TimeOfDay partial, Chronology chrono) 

Source Link

Document

Constructs a TimeOfDay with values from this instance and a new chronology.

Usage

From source file:com.moss.jodapersist.StringTimeOfDayUserType.java

License:Open Source License

public Object nullSafeGet(ResultSet resultSet, String[] names, Object arg2)
        throws HibernateException, SQLException {
    Calendar calendar = new GregorianCalendar(timeZone);

    String time = resultSet.getString(names[0]);
    if (time == null)
        return null;
    String[] pieces = time.split(":");
    if (pieces.length != 2)
        throw new HibernateException("Invalid format (should be hh:mm) \"" + time + "\"");

    return new TimeOfDay(Integer.parseInt(pieces[0]), Integer.parseInt(pieces[1]));
}

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

License:Apache License

@Override
public TimeOfDay fromNonNullValue(Long value) {
    return new TimeOfDay(value / 1000000L, ISOChronology.getInstance(DateTimeZone.UTC));
}