Example usage for org.joda.time TimeOfDay getChronology

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

Introduction

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

Prototype

public Chronology getChronology() 

Source Link

Document

Gets the chronology of the partial which is never null.

Usage

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

License:Apache License

@Override
public Time toNonNullValue(TimeOfDay value) {

    DateTime zonedValue = new LocalDateTime(1970, 1, 1, value.getHourOfDay(), value.getMinuteOfHour(),
            value.getSecondOfMinute(), value.getMillisOfSecond(), value.getChronology()).toDateTime();

    final Time time = new Time(zonedValue.getMillis());
    return time;//from  www .j av a 2 s  . c o  m
}

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

License:Apache License

@Override
public Timestamp toNonNullValue(TimeOfDay value) {

    DateTime zonedValue = new LocalDateTime(1970, 1, 1, value.getHourOfDay(), value.getMinuteOfHour(),
            value.getSecondOfMinute(), value.getMillisOfSecond(), value.getChronology()).toDateTime();

    final Timestamp timestamp = new Timestamp(zonedValue.getMillis());
    return timestamp;
}