mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-18 14:58:47 +00:00
ScalarTypeLocalDate update - some test ordering issues
This commit is contained in:
1 parent
33ab7eb7a5
commit
641385aab5
7 files changed
+113
-78
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user