ScalarTypeLocalDate update - some test ordering issues

This commit is contained in:
rbygrave
2014-11-14 01:01:32 +13:00
parent 33ab7eb7a5
commit 641385aab5
7 changed files with 113 additions and 78 deletions
@@ -6,6 +6,8 @@ import java.sql.Date;
import java.sql.Timestamp;
import java.sql.Types;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.ZonedDateTime;
/**
* ScalarType for java.time.LocalDate. This maps to a JDBC Date.
@@ -18,7 +20,9 @@ public class ScalarTypeLocalDate extends ScalarTypeBaseDate<LocalDate> {
@Override
public long convertToMillis(Object value) {
return convertToDate((LocalDate) value).toInstant().toEpochMilli();
LocalDate localDate = (LocalDate) value;
ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
return zonedDateTime.toInstant().toEpochMilli();
}
@Override